• 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: Using fake properties
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using fake properties


  • Subject: Re: Using fake properties
  • From: Quincey Morris <email@hidden>
  • Date: Fri, 16 Aug 2013 23:21:31 -0700

On Aug 16, 2013, at 22:51 , Ken Thomases <email@hidden> wrote:

> Dot syntax is just syntactic sugar for accessing properties through the accessors.

I agree with everything you said in your reply, except for a quibble about this one sentence.

Dot notation is *not* syntactically equivalent to method notation, not in all cases. Specifically, for dot notation to be syntactically legal, the class of the object to the left of the dot must have a visible declaration of the property name to the right of the dot (using either of the 2 ways of declaring properties).

Method notation is additionally legal when the receiver is of type 'id' and the named method is declared in any class that's visible at that point in the compilation.

Another way of saying this is that method notation can represent full polymorphism, but dot notation cannot.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >Using fake properties (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Using fake properties (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: Using fake properties
  • Next by Date: Re: After popping view controller, table view scrolls sideways
  • Previous by thread: Re: Using fake properties
  • Next by thread: editing text part in a custom NSTextFieldCell (of a NSTableView)
  • Index(es):
    • Date
    • Thread