• 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: Referring to self in property initializer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Referring to self in property initializer


  • Subject: Re: Referring to self in property initializer
  • From: Jens Alfke <email@hidden>
  • Date: Fri, 14 Aug 2015 17:26:04 -0700

> On Aug 14, 2015, at 4:32 PM, Quincey Morris <email@hidden> wrote:
>
> No, there’s no instance here. “Enclosing” doesn’t really make any sense.

It’s in the declaration of the ivar, I mean ‘stored property’, backgroundSession, so there is an instance.

But I just realized that Rick forgot the “lazy” keyword. Without that, I think the block executes at initialization time, not when the property is first accessed. (Either way, it would still make sense for ‘self’ to be available.)

—Jens
_______________________________________________

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: Referring to self in property initializer
      • From: Quincey Morris <email@hidden>
References: 
 >Referring to self in property initializer (From: Rick Mann <email@hidden>)
 >Re: Referring to self in property initializer (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Thread-safe atomic property for array
  • Next by Date: Re: Referring to self in property initializer
  • Previous by thread: Re: Referring to self in property initializer
  • Next by thread: Re: Referring to self in property initializer
  • Index(es):
    • Date
    • Thread