简体   繁体   中英

Downgrade an Xcode 4.3 project to 4.1

Does anybody have an experiencing with refactoring a project built with Xcode 4.3 down to build with 4.1? I get a black screen (not a crash) on load.

If I set a breakpoint on exception, I get an assembly breakpoint.

That leads me to believe that window or something is not getting loaded. I'm not using ARC, and the interface is built with IB. I'm using straight llvm. I have a feeling my problem is in main.

Okay, I got it.

4.1 doesn't like the way that a Universal app is built, apparently. So, here's what I did.

replace in main

@autoreleasepool {
    return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}

with this

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

The important bit is to send the appDelegate to the 4th arg of UIApplicationMain. If it's nil, it'll look for the appDelegate in the main nib. Hope this helps someone.

I would suggest creating a blank project in XCode 4.1 and 4.3 and then compare the Info.plist file and the content of .xcodeproj folder. Your problem may be actually related to specifying the main window or some of the defaults values (that could have been set in the new project and don't work properly in the old one).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM