0

を含む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 
4

2 に答える 2

0

クラッシュの原因となる可能性のある重いデータ(画像など)がアプリに読み込まれていないことを確認します。

デバイスでアプリを実行し、Instrumentまたはその他のツールを使用して低メモリで実行されていないことを確認します。

于 2013-01-25T12:48:50.580 に答える
0

アプリはシミュレーターでは正常に動作しますが、インストールして初めて実行するとデバイスでクラッシュします。アプリを 2 回目に実行しようとすると、正常に動作します。

シミュレーターからアプリを削除し、プロジェクトをクリーンアップし、再構築して、アプリを再度実行します。シミュレーターでもクラッシュする可能性があります。

于 2013-01-25T11:49:25.457 に答える