This may be of little use to anyone, but it's possible to return from UIApplicationMain by nesting the call in a try{}catch(NSException* e){} block. I'm currently doing this for testing my setup process, in order to run some logic after the application exits. I'd like to take this a step further and actually write separate UIApplication sub classes and run them in serial but UIApplicationMain doesn't want to play nice, it's a singleton and it must remember what it once was (the first UIApplication to be instantiated). Here's the error I get when I attempt to create a second UIApplication after returning from the first call to UIApplicationMain...
2010-12-28 16:01:36.890 SomeFakeAppName[26993:207] *** Assertion failure in UIApplicationInstantiateSingleton(), /SourceCache/UIKit_Sim/UIKit-1447.6.4/UIApplication.m:1263
So, two questions:
I understand that I'm probably 'Doing It Wrong' but how might I go about clearing UIApplication's memory so that it thinks each successive UIApplication instantiation is its first?
If this is a dead end I may try replacing UIApplicationMain by manually setting up the main event loop and instantiating the UIApplication, has anyone done this?