我有一个@property(nonatomic,strong) NSMutableArray *categoriesArray;
,该方法在- (void)viewDidLoad
方法中填充了类别。但是,我相信- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
正在执行,然后类别可以填充到我的categoriesArray
中。我在哪里插入我的代码来填充categoriesArray
,以便在调用表格单元方法时填充它?Tableview单元格在viewDidLoad方法之前填充方法
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Category Cell" forIndexPath:indexPath];
NSDictionary *category = self.categoriesArray[indexPath.row];
//cell.textLabel.text = [category valueForKey:@"categoryName"];
return cell;
}
你是如何填充您的数据如果一个异步请求时,不要忘记在年底重新加载数据'[的tableView reloadData]' – meda 2014-09-01 22:57:39