how to set the NSApp delegate?
how to set the NSApp delegate?
- Subject: how to set the NSApp delegate?
- From: email@hidden
- Date: Fri, 10 May 2002 14:33:15 -0700
Newbie question:
I've set up my small UI in IB, and I've defined a class A whose
instance needs to be the delegate of the NSApp. I've implemented some
of the delegate methods in the class, which only NSLog for now. In
IB, I've connected a B instance to the delegate of File Owner.
@implementation B
- (id) init
{
[super init];
return self;
}
- (void) applicationDidFinishLaunching: (NSNotification *) aNotification
{
NSLog(@"application finished launching");
}
etc.
@end
When I run the app, none of the methods get called. What is not clear
to me is when a instance of class B gets created and assigned as
delegate.
Is it done when the nib file is loaded? If so, what am I doing wrong,
and how do I assign this instance to a variable?
If I need to assign it programmatically myself, where do I do it,
since main calls NSApplicationMain directly in the generated main.m
file.
Thanks for any insight,
--prashanth
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.