• 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: ARC and blocks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ARC and blocks


  • Subject: Re: ARC and blocks
  • From: Abdul Sowayan <email@hidden>
  • Date: Thu, 26 Jan 2012 19:31:16 -0500
  • Thread-topic: ARC and blocks

Hi,

> So, when myController is nil'ed out, ARC releases it, and it releases
> the block in turn.  No leaks/abandoned memory.
>
> A special form of this is the idiom:
>
> __block id mySelf = self;
>
> ^{
>   [mySelf doSomething];
> }

Wouldn't using __weak instead of __block be better and clearer in the above context?

Thanks,
Abdul


>
> This lets you use self in a block without retaining it.
>
> --
> Conrad Shultz
>
> Synthetiq Solutions
> www.synthetiqsolutions.com
> _______________________________________________
>
> 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

_______________________________________________

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: 
 >ARC and blocks (From: "Jan E. Schotsman" <email@hidden>)
 >Re: ARC and blocks (From: Conrad Shultz <email@hidden>)

  • Prev by Date: Full-Height Toolbar Item
  • Next by Date: Re: ARC and blocks
  • Previous by thread: Re: ARC and blocks
  • Next by thread: Re: ARC and blocks
  • Index(es):
    • Date
    • Thread