简体   繁体   中英

application:didFinishLaunchingWithOptions: not getting called on iPad

I have a project I am working on to get it ready for Retina 4. It used MainWindow.xib files (one for iPhone and one for iPad) previously, but I have removed those (and the references to them in the project settings) and replaced it with allocating the window in the application's application:didFinishLaunchingWithOptions: method. Everything is working fine on iPhone at old and new resolutions however when I tried it on iPad (simulator and device) The application:didFinishLaunchingWithOptions: never gets called... I put an NSLog at the top of the method to make sure it wasn't just silently crashing some how but I never get the log output. App launches and just goes black. I have tried resetting the simulator, but again it happens on device and simulator and that had no effect. This happens on iOS 5, 5.1 and iOS 6 on both retina and non retina, as well as on devices so it doesn't seem to be an OS or simulator problem. The exact same code (universal project) works on iPhone fine so I'm a bit stumped as to how it can get confused and ignore the application delegate...

There are various ways to set the AppDelegate class. The NIB is one, the main routine another:

main.m
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));

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