2011-12-29 9 views
0

私はユニバーサルアプリ(iPhoneとiPad)で作業しています。私は設定ビューを表示するはずのボタンがあり、iPad用とiPhone用の2つの別々のXIBファイルがあります。私は次のコードを持っています:iPhoneがロード時に空白を表示する

settingsView* sv=[[settingsView alloc]initWithNibName:@"settingsView" bundle:nil]; 
settingsView* isv=[[settingsView alloc]initWithNibName:@"settingsView_iPad" bundle:nil]; 

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { 

    [self presentModalViewController:sv animated:YES]; 
    NSLog(@"I am an iPhone"); 

} 

if([[UIDevice currentDevice] userInterfaceIdiom]== UIUserInterfaceIdiomPad) { 

    [self presentModalViewController:isv animated:YES]; 
    NSLog(@"I am an iPad"); 
} 

このコードは、ステータスバーが上部にある黒色の画面をデバイスに表示します。なぜ私は考えていない。どんな助けでも大歓迎です。

敬具、この問題を解決するための

ハーシュK.バルガヴァ

答えて

0

最良の方法は、ドラッグであり、あなたのClass.xibファイルに空の2のUIViewControllerをドロップします。 2つの@property(nonatomic、retain)ClassAVCと@property(nonatomic、retain)ClassBVCを作成し、空のUIViewControllerの接続をclass.xibファイルにドロップし、NIB名をsettingsViewおよびsettingsView_ipad nibファイル名に変更します。その後

[self presentModalViewController:ClassAVC animated:YES]; 
    [self presentModalViewController:ClassBVC animated:YES]; 

など

[self.navigationController pushViewController:ClassAVC animated:YES]; 
    [self.navigationController pushViewController:ClassBVC animated:YES]; 
を試してみてください
関連する問題