application:didFinishLaunchingWithOptions: is not executed (maybe Mountain Lion issue?)
===

I have an iPhone-app that was in appstore for some month (from Nov.2011 until now). On July, 17th I passed an update to itunes and today they rejected it. They sayed it displayes only a black screen when running on an iPad. I tested it, and really, the splash-screen-picture showes up and after few seconds it is replaced not by the apps 1st screen, but by a black screen. (iPad-Simulator as well as physical iPad). But there was no message in Xcodes console.

So, I started the app on my iPhone where I loaded it before July 17th and where I did test the app before releasing: It did run perfectly.

Then I did start it from Xcode on the iPhone-Simulator: Splash-Picture, then black screen but no message in console.

So I connected my iPhone and loaded the newly compiled Version to my iPhone: Black screen!!!


To find out more, I inserted this line into my code at several places in main.m and in appDelegate.m:

    NSLog(@"%s Line %d",__PRETTY_FUNCTION__,__LINE__);

---
Content of main.m:

    //(some comment-lines)
    #import <UIKit/UIKit.h>

    int main(int argc, char *argv[])
    {
        NSLog(@"%s Line %d",__PRETTY_FUNCTION__,__LINE__); //this is line 13
        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
        NSLog(@"%s Line %d",__PRETTY_FUNCTION__,__LINE__); //this is line 15
        int retVal = UIApplicationMain(argc, argv, nil, nil);
        NSLog(@"%s Line %d",__PRETTY_FUNCTION__,__LINE__); //this is line 17
        [pool release];
        NSLog(@"%s Line %d",__PRETTY_FUNCTION__,__LINE__); //this is line 19
        return retVal;
    }

---
I also entered this line in appDelegate.m:

    - (BOOL) application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
        NSLog(@"%s Line %d",__PRETTY_FUNCTION__,__LINE__);
        // some more code
    }

---
When I run the app, there are only those two lines displayed in Xcodes console:

    2012-07-28 11:03:29.548 nulowi[4072:c07] int main(int, char **) Line 13
    2012-07-28 11:03:29.553 nulowi[4072:c07] int main(int, char **) Line 15


So it looks, as if main in main.m was executed and the Autoreleasepool was created. But then, after calling UIApplicationMain in main.m and before calling application:didFinishLaunchingWithOptions: in the apps delegate, there must happened something, and I don't know what this could be.

Maybe it has something to do with the upgrade from Mac OS X 10.7 (Lion) to OS X 10.8 (Mountain Lion) on my MacBook Pro? When I released the ready-tested app on July 17th from my MacBook with version 10.7, everything was fine. Yesterday I installed the update from 10.7 to 10.8.

And now, when trying to run from version 10.8, application:didFinishLaunchingWithOptions: will not be called.