我有一個@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