1

で例外が発生しましたdequeueReusableCellWithIdentifier:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"pointcell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];// Here is exception 
    if( cell == nil)
    {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }

    ...

    return cell;
}

例外:

*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UITableViewCell 0xca51470> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key accessoryActionSegueTemplate.'

ストーリーボードのカスタム型セルに識別子を設定しました。ストーリーボードでアクセサリ アクション セグエを設定しました。その特定のタイプに関連していると思いますが、クラッシュを防ぐために何をすべきかわかりません。

4

1 に答える 1

0

少し遅すぎるようですが、同じ問題に直面して解決策を見つけました。

Interface Builder で UITableViewCell からセグエを Control+ドラッグすると、セルまたはアクセサリ ビューのセグエを作成できます。アクセサリ ビュー用に作成し、iOS 5 でアプリを実行すると、そのバージョンではアクセサリ セグエがサポートされていないため、問題が発生します。

代わりに ViewController からセグエをドラッグして、このコードを含めることができます (ここから取得):

- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
{
    [self performSegueWithIdentifier:@"SegueID" 
                              sender:[tableView cellForRowAtIndexPath:indexPath]];
}
于 2013-12-17T08:37:57.737 に答える