The iPhone Reference Libary - UIApplication says I can subclass UIApplication, but if I try this I will get an exception:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'There can only be one UIApplication instance.'
This reminds me of the Highlander "There can be only one,. :-)
Do I have to pass other argurments to UIApplicationMain? Or did I missread somthing in the libary?
The UIApplication encapsulates the central administrative properties of an application running on iOS. Application developers must not instantiate new UIApplications using constructors, but instead must use the static SharedApplication singleton property.
UIApplicationMain(_:_:_:_:)Creates the application object and the application delegate and sets up the event cycle.
Did you pass the name of your subclass to UIApplicationMain? Let's assume you have
@interface MyUIApp : UIApplication
...
then in main() you should do:
NSString* appClass = @"MyUIApp";
NSString* delegateClass = nil;
int retVal = UIApplicationMain(argc, argv, appClass, delegateClass);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With