我传递一个名为userArray
的数组,其中存储了另一个带有字符串的数组。这是我迄今为止的,但我知道这是错误的。有人能指引我朝着正确的方向吗?从数组中添加单元格到UITableView
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"Cell";
CustomCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(cell == nil) {
cell = [[CustomCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier];
}
//Set Up Cell
DataSingleton *sharedData = [DataSingleton sharedData];
for (NSArray *array in sharedData.usersArray){
cell.primaryLabel.text = [array objectAtIndex:1];
cell.secondaryLabel.text = [array objectAtIndex:2];
cell.profileImage = [UIImage imageNamed:@"111-user.png"];
return cell;
}
}
是您的收益咋办在for循环中? – ferdil 2012-02-23 05:53:37