More NSUndoManager woes
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