• 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: Storing a block in a CF/NSMutableDictionary?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Storing a block in a CF/NSMutableDictionary?


  • Subject: Re: Storing a block in a CF/NSMutableDictionary?
  • From: Kyle Sluder <email@hidden>
  • Date: Fri, 08 Apr 2011 21:05:46 -0700

On Fri, Apr 8, 2011 at 9:03 PM, Kyle Sluder <email@hidden> wrote:
> If you reference a stack variable from your block, you cannot allow
> that block to escape the scope of that variable.

Well, I suppose it's worth mentioning that read-only NSObject
variables are okay to use in this fashion because the compiler is
smart enough to retain the object when the block gets copied. (Beware
any retain cycles this may create! See Mike Ash's MAZeroingWeakRef.)

I was under the impression you were using the variable for general purposes.

I should have just stuck with Dave's recommendation to ask you to post
your code…

--Kyle Sluder
_______________________________________________

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: 
 >Storing a block in a CF/NSMutableDictionary? (From: Rick Mann <email@hidden>)
 >Re: Storing a block in a CF/NSMutableDictionary? (From: Kyle Sluder <email@hidden>)
 >Re: Storing a block in a CF/NSMutableDictionary? (From: Rick Mann <email@hidden>)
 >Re: Storing a block in a CF/NSMutableDictionary? (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Storing a block in a CF/NSMutableDictionary?
  • Next by Date: Re: CFXMLTreeRef
  • Previous by thread: Re: Storing a block in a CF/NSMutableDictionary?
  • Next by thread: Re: Storing a block in a CF/NSMutableDictionary?
  • Index(es):
    • Date
    • Thread