• 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
Re: Making an object accessible by both MyDocument AND a custom class
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: David Remahl <email@hidden>
  • Date: Wed, 25 Sep 2002 20:44:29 +0200

>> You certainly CAN send messages to nil! I do it all the time.
>
> Sure you can.
>
>> It sends the message up the responder chain.
>
> No it does not. At least I dearly hope it does not!
>
> From Apple's "Object-Oriented Programming and the Objective-C
> Language", June 2000, chapter 3, page 53:
>
> "A message to nil is also valid, as long as the message returns an
> object; if it does, a message sent to nil will return nil. If the
> message sent to nil returns anything other than an object, the return
> value is undefined."

An _action_ with a target of nil will target the first responder and walk
down the responder chain.

A simple message to nil will not have the same effect. To send an action in
that way:

[NSApp sendAction:[self action] to:[self target] from:self];

>> Have you not heard of a nil target before? Can I get a witness out
>> there please?
>
> I'm sorry. :}

Nil target != nil receiver, in this case.

/ Rgds, David
_______________________________________________
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.

References: 
 >Re: Making an object accessible by both MyDocument AND a custom class (From: Andreas Mayer <email@hidden>)

  • Prev by Date: Re: Making an object accessible by both MyDocument AND a custom class
  • Next by Date: Re: Making an object accessible by both MyDocument AND a custom class
  • Previous by thread: Re: Making an object accessible by both MyDocument AND a custom class
  • Next by thread: Re: Making an object accessible by both MyDocument AND a custom class
  • Index(es):
    • Date
    • Thread