• 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: How did I miss this?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: How did I miss this?
      • From: mmalc crawford <email@hidden>
References: 
 >How did I miss this? (From: John Murphy <email@hidden>)

  • Prev by Date: Re: How did I miss this?
  • Next by Date: Re: NSRunLoop run semantics
  • Previous by thread: Re: How did I miss this?
  • Next by thread: Re: How did I miss this?
  • Index(es):
    • Date
    • Thread