我正在寫我的第一個通用應用程序,我已經轉換了我的筆尖,以便有iPad和iPhone版本。iOS通用應用程序 - 訪問iPad和iPhone的不同筆尖
iPad版本位於Resources-iPad文件夾中,名爲「InfoViewController-iPad.xib」。 iPhone版的主文件夾,名爲「InfoViewController.xib」
我有以下動作,以顯示相關的廈門國際銀行
-(void) touchesBegan: (NSSet *) touches withEvent: (UIEvent *) event {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
infoViewController = [[InfoViewController alloc] initWithNibName:@"Resources-iPad/InfoViewController-iPad" bundle:nil];
}
else
{
infoViewController = [[InfoViewController alloc] initWithNibName:@"InfoViewController" bundle:nil];
}
infoViewController.delegate = self;
infoViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:infoViewController animated:YES];
[infoViewController release];
}
當這個運行在它工作正常的iPhone,但它崩潰時運行在iPad上。 任何幫助將真的被賞識
文件夾名稱的答案是正確的,但你真的應該知道它崩潰的地方,並注意到infoViewController是零。然後試圖弄清楚。 –