[NSApp setDelegate]
[NSApp setDelegate]
- Subject: [NSApp setDelegate]
- From: email@hidden
- Date: Tue, 5 Jun 2001 13:55:41 -0400
Please forgive me if this question is exceedingly stupid.
I'm trying very hard to work my head around creating a delegate for my
application, but am having some trouble. I know what delegates do, and I
know why I need them. What I don't know is how to instantiate them.
NSApplication has a method [NSApp setDelegate] which (I would assume)
would be called either in the NSApplication's init: method, or from
another already instantiated class. Looking through Apple's supplied
examples (Sketch and TextEdit), I don't see this method being called,
even though each app has a delegate. While looking at the source for the
apps, I notice that neither delegate is called from code or has a custom
init: method. With out calling [NSApp setDelegate] how does an app know
which class should implement the delegate method? Does NSApp send a
[myClass respondsTo:] method to all instantiated classes? Is there a
setting in IB or PB that I am missing?
--Robert Lee Dotson
"The illegal we do immediately. The unconstitutional takes a little bit
longer."