Re: Using fake properties
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