Application Member - Cocoa

I want to include applicationDidFinishLaunching: in my cocoa delegate. How can I do it? On the iphone SDK, applicationDidFinishLaunching is already present in the deletion of the application, but when I created my Mac application, I noticed that it was not there.

Regards,

Kevin

+5
source share
3 answers

As in Xcode 3.2, the Mac application template also comes with an already delegated application delegate that has such a method.

, Xcode 3.2, . "AppDelegate". , "" " ", Cocoa NSObject.

(AppDelegate.h). , . Go to Counterpart. (AppDelegate.m). applicationDidFinishLaunching:. iPhone, - , NSNotification, NSApplication.

. "" MainMenu.nib. (, , " " " " ). , , . AppDelegate, , Xcode. delegate .

Xcode NSLog applicationDidFinishLaunching:. Hit Save All, Build and Go. Xcode . , , .

+20
- (id)init
{
    if (self = super init]) {
        [NSApp setDelegate:self];
    }
    return self;
}

Interface Builder; "File Owner" MainMenu.xib, "" . -awakeFromNib.

+6

You didn’t have application delegation files? There seems to be an error in the Xcode installation scripts (at least for 3.2.1 on Snow Leopard) that installs the latest project templates in the wrong folder. The older Cocoa Application project template does not contain delegate files.

I explained what I discovered (and how I “fixed” it) in a blog post called Fixing Xcode Project Templates .

Cheers graham

0
source

All Articles