0
當試圖將我的項目構建到我的iPod touch 1st gen 3.1.3時,項目會構建,並將其放在我的iPod上,但在啓動時會引發NSExeption,並且在我的應用程序委託中在線self.window.rootViewController = self.viewController;
處提供了一個SIGABRT。部署目標是3.0,SDK是4.2。它建立在我的iPad上運行4.2。這裏有什麼問題?在Xcode 4中構建到iPod Touch 3.1.3
解決:替換「self.window.rootViewController = self.viewController;」與「[self.window addSubview:_viewController.view];」
@implementation Physics_ProjectAppDelegate
@synthesize window=_window;
@synthesize viewController=_viewController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
[self.window addSubview:_viewController.view];
[self.window makeKeyAndVisible];
return YES;
}
那麼我該怎麼做才能使它起作用?很明顯,我需要這個來加載視圖,但有沒有辦法繞過它來使它在我的設備上工作? –
'[window addSubView:myController.view]'See [this](http://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/CreatingWindows/CreatingWindows.html#//apple_ref/doc/ uid/TP40009503-CH4-SW6) –
@Conor,我的回答對你有幫助嗎? –