2011-11-09 41 views
2

我的iPhone應用程序運行在iPhone模擬器和設備上,但不是在iPad模擬器上。它沒有顯示任何錯誤,但應用程序沒有啓動只是空白的黑屏只顯示。iphone應用程序不工作ipad模擬器

雖然在ipad模擬器運行5它表示以下錯誤「的應用預期具有在應用程序啓動的端部的根視圖控制器」

我的應用程序didFinishLaunchingWithOptions代碼是如下:

rootViewController = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil]; 
[self.rootViewController.view setFrame:CGRectMake(0, 20, 320, 460)]; 
[self.window addSubview:self.rootViewController.view]; 

[self.window makeKeyAndVisible]; 
return YES; 

我的main.m代碼如下:

NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 
int retVal = UIApplicationMain(argc, argv, nil, nil); 
[pool release]; 
return retVal; 

這是什麼問題?

+0

當你開始你的應用程序時,你選擇了一個通用的應用程序?如果是,您是否實施了iPad視圖? – alinoz

回答

0

如果你改變了這個:

rootViewController = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil]; 

這樣:

self.rootViewController = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil]; 
+0

沒有改變...我需要在IB bcoz做任何事情,目前我的rootviewcontroller插座沒有針對任何東西......這可能是一個原因? – itdeeps

1

圍棋在App目標信息,並設置「目標設備系列」:「iPhone」,那麼它工作正常上都iphone和ipad模擬器和設備。

0

檢查....導航控制器委託必須已連接(委託> AppDelegate)在IB中。

相關問題