を含むiPad用のアプリを開発していますUITableView
。アプリはシミュレーターでは正常に動作しますが、デバイスをインストールして初めて実行するとクラッシュします。アプリを 2 回目に実行しようとすると、問題なく動作します。何が問題なのかわかりません。同じコードは IPhone では問題なく動作しますが、IPad ではクラッシュします。テーブルに次のコードを使用しています
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *MythoViewCellIdentifier = @"MythoViewCellIdentifier ";
UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:MythoViewCellIdentifier];
if (cell==nil)
{
cell=[[[UITableViewCell alloc] initWithFrame:CGRectZero] autorelease];
}
[self getMythoData];
UIImageView *imgLogo =[[UIImageView alloc] initWithFrame:CGRectMake(-1,0,37,35)];
imgLogo.backgroundColor =[UIColor clearColor];
imgLogo.image=[UIImage imageNamed:@"bullet_swastik.png"];
[cell.contentView addSubview:imgLogo];
UITextView *txtDetails =[[UITextView alloc] initWithFrame:CGRectMake(37,34,740,200)];
txtDetails.backgroundColor =[UIColor clearColor];
txtDetails.editable=NO;
txtDetails.font=[UIFont systemFontOfSize:25.0];
[cell.contentView addSubview:txtDetails];
// adding details to the cell
txtDetails.text = [NSString stringWithFormat:@"%@",[FinalmythoData objectAtIndex:indexPath.row]];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
[txtDetails release];
return cell;
}
I'm getting the following error
Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes:
KERN_INVALID_ADDRESS at 0x00000000 Crashed Thread: 0
Thanks