/ Published in: Objective C
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
@interface PurchaseWindowViewController : UIViewController { IBOutlet UITableView* listView; NSArray* subscriptions; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier] autorelease]; } cell.textLabel.text = [subscriptions objectAtIndex:indexPath.row]; return cell; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 4; } // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { subscriptions = [[NSArray alloc] initWithObjects:@"8 week - $23.92", @"13 week - $38.87", @"26 week - $77.74", @"52 week - $155.48", nil]; listView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth; [listView reloadData]; }