Re: Making an object accessible by both MyDocument AND a custom class
Re: Making an object accessible by both MyDocument AND a custom class
- Subject: Re: Making an object accessible by both MyDocument AND a custom class
- From: John Hörnkvist <email@hidden>
- Date: Wed, 25 Sep 2002 20:43:57 +0200
On Wednesday, September 25, 2002, at 07:43 PM, Joe Lester wrote:
You certainly CAN send messages to nil! I do it all the time. It sends
the message up the responder chain. Have you not heard of a nil target
before? Can I get a witness out there please?
There are two different things here;
1) Nil receiver
[nil doSomething:sender];
2) Nil target in the target/action system
[button setTarget:nil];
[button setAction:@selector(doSomething:)];
For case 1, the Objective-C runtime checks the value of the receiver,
and finding that it is nil simply returns to the caller.
For case 2, the user interface object uses nil as a special case which
tells it to use the responder chain instead of sending the action to
some specific object. This is not a feature of the runtime but an
implementation detail in the AppKit.
Regards,
John Hornkvist
_______________________________________________
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.