• 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: Dave DeLong <email@hidden>
  • Date: Fri, 08 Apr 2011 17:46:36 -0700

Please post your code.

Dave

Sent from my iPhone

On Apr 8, 2011, at 5:25 PM, Rick Mann <email@hidden> wrote:

> Hi. In my garbage collection-required app, I'm trying to store a code block (void (^)(void)) in a CFMutableDictionary. The docs says copy/retain/release can be sent to a block, suggesting this can be done. But it's not working. When I later retrieve the block and call it, I get an EXEC_BAD_ACCESS.
>
> This is when the block references an NSObject declared & allocated in the block's enclosing scope. If I don't access that variable, it executes fine.
>
> This tells me the block isn't being properly copied as it is inserted into into the dictionary.
>
> Is there something I can do to allow this to work? Thanks.
>
> --
> Rick_______________________________________________
>
> 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: 
 >Storing a block in a CF/NSMutableDictionary? (From: Rick Mann <email@hidden>)

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