• 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: Blocks: object retaining behavior?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Blocks: object retaining behavior?


  • Subject: Re: Blocks: object retaining behavior?
  • From: Antonio Nunes <email@hidden>
  • Date: Wed, 14 Mar 2012 17:11:47 +0000

On 14 Mar 2012, at 16:48, Jens Alfke wrote:

>> My assumption is that the savePanel will be held on by the block for as long as it exists. But now I wonder whether that assumption is correct, and this retaining/copying behaviour only happens when the block is copied.
>
> True, ‘savePanel’ will only be retained by the block when it’s copied. But the block has to be copied as part of the implementation of the beginSheetModalForWindow method, because the sheet has to hold onto a reference to the block to invoke later after the method returns. So the method has to copy the block and assign it to some state associated with the sheet. The copied block object will end up retaining savePanel.

Thanks Jens, so I need to look further to track down the crash. This was the most obvious thing I could think of where my own code could be at fault. My hunch though, is that the crash is due to a system framework bug (in NSSavePanel, or, more specifically, in NSRemoteSavePanel).

-António

--------------------------------------------
I try to take one day at a time, but sometimes, several days attack me all at once!
--------------------------------------------



_______________________________________________

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: 
 >Blocks: object retaining behavior? (From: Antonio Nunes <email@hidden>)

  • Prev by Date: Re: [Q] Why is the threading and UI updating designed to be done only on a main thread?
  • Next by Date: Re: [Q] Why is the threading and UI updating designed to be done only on a main thread?
  • Previous by thread: Blocks: object retaining behavior?
  • Next by thread: Cocoaheads meeting tonight in Lake Forest
  • Index(es):
    • Date
    • Thread