/ Published in: iPhone
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
.h file: @interface ResultsViewController : UITableViewController { NSMutableArray *m_list; NSDictionary *localDict; } @end ======================== .m file: - (void)viewDidLoad { [super viewDidLoad]; NSDictionary *tempDict; AdInfo *shAdInfo = [AdInfo sharedAdInfo]; tempDict = shAdInfo.adInfoDict; int nCountDict = [tempDict count]; NSLog(@"nCountDict: %d", nCountDict); //////////////////////// int ctr; for(ctr = 1; ctr <= nCountDict; ctr++) { [myMutableArr addObject:localDict]; } self.m_list = myMutableArr; [myMutableArr release]; NSLog(@"m_list count: %d", [m_list count]); } ..... - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } // Configure the cell... NSUInteger row = [indexPath row]; //NSLog(@"newDict desc: %@", [newDict description]); cell.textLabel.text = rowString; [rowString release]; return cell; }