0
的帮助为什么indexPath.Row总是返回0 ???在下面的方法中需要NSIndexPath
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell.
[cell.textLabel setText:[mainItems objectAtIndex:indexPath.row]];
return cell;
}
mainItems是NSMutableArray的,有5个项目( “项目1”, “项目2”,...)的View也获得5项......但他们都 “项目1”,而不是项目1,第2项...
我做错了什么?
tks很多...事实上,我设置部分= [mainItens计数],而不是项目!我会尽快标记为正确的! – Leonardo