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.
猜测:您没有设置将applicationDidFinishLaunching定义为应用程序委托的对象。
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);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.