• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
how to set the NSApp delegate?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: how to set the NSApp delegate?
      • From: email@hidden
  • Prev by Date: [really OT] Re: [OT] April Dev Tools
  • Next by Date: Re: Datagram Socket Reading?
  • Previous by thread: Re: DO proxy question
  • Next by thread: Re: how to set the NSApp delegate?
  • Index(es):
    • Date
    • Thread