开发者

Building to iPod Touch 3.1.3 in Xcode 4

开发者 https://www.devze.com 2023-03-06 02:19 出处:网络
开发者_高级运维When trying to build my project to my iPod touch 1st gen 3.1.3, the project builds, and it put on my ipod, but then at launch it throws an NSExeption, and gives a SIGABRT at the line se
开发者_高级运维

When trying to build my project to my iPod touch 1st gen 3.1.3, the project builds, and it put on my ipod, but then at launch it throws an NSExeption, and gives a SIGABRT at the line self.window.rootViewController = self.viewController; in my app delegate. The deployment target is all right at 3.0, and the SDK is 4.2. It builds to my iPad running 4.2 fine. What is the problem here?

SOLVED: replace "self.window.rootViewController = self.viewController;" with "[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;
}


According to documentation, [UIWindow rootViewController] is "Available in iOS 4.0 and later." and that is why your app crashes on the actual device which is is 3.1.3 as you say.

0

精彩评论

暂无评论...
验证码 换一张
取 消