I am wanting both my AppDelegate and my ViewController to be called on startup (as expected).
When only the ViewController is called:
main.c
int main(int argc, const char * argv[]) {
return NSApplicationMain(argc, argv);
}
When the AppDelegate is called and the view controller is not.
main.c
#import "AppDelegate.h"
int main(int argc, const char *argv[])
{
NSArray *tl;
NSApplication *application = [NSApplication sharedApplication];
[[NSBundle mainBundle] loadNibNamed:@"ViewController" owner:application topLevelObjects:&tl];
AppDelegate *applicationDelegate = [[AppDelegate alloc] init]; // Instantiate App delegate
[application setDelegate:applicationDelegate]; // Assign delegate to the NSApplication
[application run]; // Call the Apps Run method
return 0; // App Never gets here.
}
I think my problem is that with the second attempt of the main.c is that...
NSApplication *application = [NSApplication sharedApplication];
[[NSBundle mainBundle] loadNibNamed:@"ViewController" owner:application topLevelObjects:&tl];
is not working as expected. Where do I actually set the 'Nib' in the IB?
What is wrong?