I'd like to do away with XIB (Nib) files in my project, because that's just how I roll. However I'm finding that my AppDelegate class's method didFinishLaunchingWithOptions is never even called.
I tried setting the principal class in my app's main plist like so:
<key>NSPrincipalClass</key>
<string>AppDelegate</string>
This only leads to an error:
+[AppDelegate registerForSystemEvents]: unrecognized selector sent to class
So... how can I do without the principal class and just have my AppDelegate class run?
Thanks.
The easiest thing to do is just start with an appropriate project template... choosing "Empty Application" does not create a nib, but does properly setup you main.m with the following crucial line:
I think registerForSystemEvents is a private method on UIApplication, which makes sense since the principal class should be UIApplication or subclass thereof, not a responder conforming to UIApplicationDelegate.
The UIApplicationMain() call above will set your principal class to UIApplication and the delegate to your custom AppDelegate class.
But as I said - just make life simple by using the appropriate project template.