ビューコントローラの1つにテーブルビューがあり、次を使用して編集モードに設定されています。
self.navigationItem.rightBarButtonItem = self.editButtonItem;
また、セルのeditingAccessoryTypeを適切なUITableViewCellAccessoryTypeに設定しています。
- (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];
}
NSString *cellLabel = [cellDetails objectAtIndex:indexPath.row];
NSString *cellData = [movieDictionary objectForKey:cellLabel];
cell.textLabel.text = [[NSString alloc] initWithFormat:@"%@ %@", cellLabel, cellData];
cell.editingAccessoryType = UITableViewCellAccessoryCheckmark;
cell.accessoryType = UITableViewCellAccessoryNone;
return cell;
}
内cellForRowAtIndexPath
。ただし、[編集]ボタンをタップすると、アクセサリが表示されません。テーブルは編集モードに設定されています(setEditing
呼び出されています)。誰かが私が見逃しているものを知っていますか?