uitableviewに取り組んでいますが、uitableviewcell内でカスタムuiviewcontrollerを使用すると、ランダムにクラッシュします。
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(!cell){
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
SuspectSalesResponse* r = [valueArray objectAtIndex:indexPath.row];
SuspectSalesCellViewController* scellView = [[SuspectSalesCellViewController alloc]initWithNibName:@"SuspectSalesCellViewController" bundle:nil cellData:r];
if(![cellViewArray containsObject:scellView])
[cellViewArray addObject:scellView];
[cell.contentView addSubview:scellView.view];
}
return cell;
このコードは機能する場合もあれば、次のエラーが発生する場合もあります。
* -[SuspectSalesHeaderViewController _parentModalViewController]:割り当て解除されたインスタンス0x8556880に送信されたメッセージ
contentviewsを配列(cellViewArray)内に保持しようとしましたが、運が悪かったのですが、それでもこのエラーが発生します。私は何が間違っているのですか?
助けてくれてありがとう!