// 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;
}
}
Im here to learn
You seem to think that
NSUInteger row = [indexPath row];{ ... }is something like C#’susing. It’s not, it’s just like the similar construct in C. So you are declaring the local variable “row” twice, and the compiler is warning you about it.As for the warning that “setText” is deprecated, that’s because it is. See the documentation. You’ll most likely want to use
cell.textLabel.textinstead.