applicationDidFinishLaunching not running
So I'm starting out with cocoa and ObjC. I'm trying to follow the example in the up and running objective C/cocoa book from oreilly. My applicationDidFinishLaunching doesn't seem to be getting called. I think it's a problem with the way I hooked everything up 开发者_高级运维in the IB.
Header: http://pastebin.com/6AdQt1uN
Class: http://pastebin.com/VCQWJWkj
IB: http://img265.imageshack.us/img265/4616/screenshot20110216at111.png
Does anyone see anything obvious that my untrained eyes do not?
Does your Application
object have it's delegate set to your Application App Delegate
object? Right click on Application
in your IB window and set the delegate
outlet to be your Application App Delegate
object.
A guess: you didn't set the object where you defined applicationDidFinishLaunching as the delegate for your app.
for those who do not use IB, make sure you specify the app delegate in main.m in the following way:
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
instead of:
return UIApplicationMain(argc, argv, nil, nil);
精彩评论