equal
deleted
inserted
replaced
15 * along with this program; if not, write to the Free Software |
15 * along with this program; if not, write to the Free Software |
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
17 */ |
17 */ |
18 |
18 |
19 #import "CampaignsViewController.h" |
19 #import "CampaignsViewController.h" |
|
20 #import "CampaignViewController.h" |
20 |
21 |
21 @interface CampaignsViewController () |
22 @interface CampaignsViewController () |
22 @property (nonatomic, retain) NSArray *campaigns; |
23 @property (nonatomic, retain) NSArray *campaigns; |
23 @end |
24 @end |
24 |
25 |
55 |
56 |
56 - (void)viewDidLoad { |
57 - (void)viewDidLoad { |
57 [super viewDidLoad]; |
58 [super viewDidLoad]; |
58 |
59 |
59 UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(dismiss)]; |
60 UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(dismiss)]; |
60 self.navigationItem.leftBarButtonItem = doneButton; |
61 self.navigationItem.rightBarButtonItem = doneButton; |
61 [doneButton release]; |
62 [doneButton release]; |
62 |
63 |
63 [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"campaignCell"]; |
64 [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"campaignCell"]; |
64 } |
65 } |
65 |
66 |
88 cell.textLabel.text = self.campaigns[indexPath.row]; |
89 cell.textLabel.text = self.campaigns[indexPath.row]; |
89 |
90 |
90 return cell; |
91 return cell; |
91 } |
92 } |
92 |
93 |
93 /* |
|
94 #pragma mark - Table view delegate |
94 #pragma mark - Table view delegate |
95 |
95 |
96 // In a xib-based application, navigation from a table can be handled in -tableView:didSelectRowAtIndexPath: |
|
97 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { |
96 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { |
98 // Navigation logic may go here, for example: |
97 NSString *xib = IS_IPAD() ? @"CampaignViewController-iPad" : @"CampaignViewController-iPhone"; |
99 // Create the next view controller. |
98 CampaignViewController *campaign = [[CampaignViewController alloc] initWithNibName:xib bundle:nil]; |
100 <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:<#@"Nib name"#> bundle:nil]; |
|
101 |
99 |
102 // Pass the selected object to the new view controller. |
100 campaign.campaignName = self.campaigns[indexPath.row]; |
103 |
101 |
104 // Push the view controller. |
102 [self.navigationController pushViewController:campaign animated:YES]; |
105 [self.navigationController pushViewController:detailViewController animated:YES]; |
103 [campaign release]; |
106 } |
104 } |
107 */ |
|
108 |
105 |
109 #pragma mark - Dealloc |
106 #pragma mark - Dealloc |
110 |
107 |
111 - (void)dealloc { |
108 - (void)dealloc { |
112 [_campaigns release]; |
109 [_campaigns release]; |