LoginSignup
1
0

More than 5 years have passed since last update.

editActionsForRowAtIndexPathでindexPath.rowが-1になる【未解決備忘録】

Last updated at Posted at 2017-06-22

環境

Xcode 8.3.3
iOS 10.3.2

ソース


- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
  id *currenData = [self.data objectAtIndex:indexPath.row];
  ** いろいろ判定 **
  return YES or return NO;
}

- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath
{
  // ここでエラー
  // indexPath.rowが-1になってる
  id *currenData = [self.data objectAtIndex:indexPath.row];
}

とりあえず-1の場合は「閉じる」ボタンだけをスワイプメニューに表示するようにして
操作のやり直しができるようにしてる。

追記(2017年8月15日)

Apple Developer Technical Supportにコードレベルの問い合わせ(サンプルも送る)をすると
「これバグなんじゃね?」
みたいな回答が返ってくる。マジかorz
そしてはBugReporterに送ってくれと言われたので、素直に送ってみた。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0