// Customize the appearance of table view cells.
- (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];
}
// Set up the cell...
NSUInteger row = [indexPath row];{
cell.text = [capitulosArray objectAtIndex:row];
return cell;
}
NSUInteger row = [indexPath row];{
cell.text = [capitulos2Array objectAtIndex:row];
return cell;
}
}
我来这里学习
答案 0 :(得分:0)
您似乎认为NSUInteger row = [indexPath row];{ ... }
类似于C#的using
。它不是,它就像C中的类似构造一样。所以你要声明局部变量“row”两次,编译器会警告你。
对于不推荐使用“setText”的警告,那是因为它是。见the documentation。您很可能希望改为使用cell.textLabel.text
。