• 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
More NSUndoManager woes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

More NSUndoManager woes


  • Subject: More NSUndoManager woes
  • From: Graham Cox <email@hidden>
  • Date: Wed, 9 Apr 2008 21:23:08 +1000

The docs for NSUndoManager state for -removeAllActionsWithTarget: that:

"An object that shares an NSUndoManager with other clients should invoke this message in its implementation of dealloc".

There is a problem with this - if the object being dealloced is itself the parameter to an undo invocation, which in anything more complicated than a trivial test case it is likely to be, then Cocoa goes into an infinite loop when it starts discarding these invocations off the bottom of the stack. The undo manager releases the invocation which releases the object, which calls - removeAllActionsWithTarget:self, and boom - it all falls over.

Can someone tell me if this recommendation is still correct, or what? The only way I can stabilize my app is simply not to attempt to do this, but I'm not really sure if there are any bad implications for NOT calling it.

Is it me, or is NSUndoManager really, really fragile?


------ S.O.S. _______________________________________________

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


  • Follow-Ups:
    • Re: More NSUndoManager woes
      • From: Alastair Houghton <email@hidden>
  • Prev by Date: Re: How to get a notification which tells a folder name got changed
  • Next by Date: Text with translucent Background
  • Previous by thread: Re: core data and IB outlet binding
  • Next by thread: Re: More NSUndoManager woes
  • Index(es):
    • Date
    • Thread