Re: How did I miss this?
Re: How did I miss this?
- Subject: Re: How did I miss this?
- From: Phil <email@hidden>
- Date: Mon, 8 Sep 2008 14:01:56 +1200
On Mon, Sep 8, 2008 at 1:25 PM, John Murphy <email@hidden> wrote:
> I just released the the view on NSViewController objects can be accessed with dot syntax, i.e., self.view instead of [self view].
> Has this always been the case? I don't see any listing of "Properties" in documentation.
> I'm hitting myself for not discovering it sooner.
>
This is accidental, from the way the compiler translates "self.view"
into "[self view]". Properties are just syntactic sugar.
The documentation on the dot syntax explains this:
<http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_2_section_3.html#//apple_ref/doc/uid/TP30001163-CH11-SW17>
The sub-section on "Incorrect Use", also explains that you shouldn't
use this syntax if it's not on a declared property (and
NSViewController doesn't have any).
Phil
_______________________________________________
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