因为accessoryTypeForRowWithIndexPath函数已经不建议使用了,要替换成:
// 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];
cell.showsReorderControl=YES;
cell.accessoryType=UITableViewCellAccessoryDetailDisclosureButton;
}
NSUInteger row=[indexPath row];
cell.textLabel.text=[dataItems objectAtIndex:row];return cell;
}
同时删除tableView:accessoryTypeForRowWithIndexPath函数。这个问题不是编辑TableView时出现的,在前面写的编写简单的导航控制器中就开始有这个问题。