Re: Storing a block in a CF/NSMutableDictionary?
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