UITableViewControllerは、excbadaccesssエラーでクラッシュします。これは私のコードです:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
NSString *cellText ;
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] ;
}
if (indexPath.row == 0)
{
cellText = @"Mail1";
}
else if (indexPath.row == 1)
{
cellText = @"Mail2";
}
else if (indexPath.row == 2)
{
cellText = @"Mail3";
}
else if(indexPath.row == 3)
{
cellText = @"Mail4";
}
else
{
cellText = @"Mail5";
}
cell.textLabel.text = cellText;
return cell;
}
これはxcodeが提供したログメッセージです
XXXXProject [1366:f803] * -[XXXXViewController tableView:cellForRowAtIndexPath:]:割り当て解除されたインスタンス0x6a793f0に送信されたメッセージ