Why this NSUndoManager strange behaviour?
Why this NSUndoManager strange behaviour?
- Subject: Why this NSUndoManager strange behaviour?
- From: Graham Cox <email@hidden>
- Date: Fri, 4 Dec 2009 12:20:49 +1100
I've noticed that under some, as yet to be determined, conditions, [NSUndoManager endUndoGrouping]; does not decrement the groupingLevel. Could someone with access to the sources tell me how this could be?
Before I call -endUndoGrouping, the level is 1. Afterwards, the level is still 1. I've turned off -setGroupsByEvent and am handling all the grouping manually.
Normally the level does get decremented from 1 to 0 as expected, but sometimes it does not. This appears to be in some way related to whether it is being called from an exception handler (catch block) or not, though I'm unsure.
When this happens, I end up with the NSUndoManager in the dreaded 'invalid state' whereby it just stops working. Since all parts of my app use Undo, this fragility is extremely detrimental to my app's functionality.
I just need to know what is the condition that causes -endUndoGrouping not to have any effect, so I can avoid that condition.
--Graham
_______________________________________________
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