核心数据和撤消错误且无重做
所以问题是: 我将一些项目放入编辑器区域,它会在幕后创建撤消分组...因为删除项目的整个过程实际上是任务的集合。 如果我随后删除任务,我可以选择撤消删除。
如果我执行此撤消操作,我会在控制台中收到错误消息: _endUndoGroupRemovingIfEmpty:: NSUndoManager 0x343f5a0 处于无效状态,调用 endUndoGrouping 时没有匹配的 begin
它确实将所有项目返回到视图中,但是......从这一点来看,我的撤消堆栈一团糟,并且没有做正确的事情。从此时起 REDO 就不再起作用了。
我也尝试过仅从工作流程中删除一项...然后撤消删除...仍然会引发错误。
那么两个问题: 1.为什么会出现这个错误。 2. 为什么我的重做功能根本不正确?
感谢您的帮助
So the issue:
I drop a some items into an editor area it creates an undo grouping...under the covers, as the whole process of dropping the items is actually a collection of tasks.
If I then delete the tasks, I am given an option to undo the delete.
If I do this undo I get an error in the console:
_endUndoGroupRemovingIfEmpty:: NSUndoManager 0x343f5a0 is in invalid state, endUndoGrouping called with no matching begin
It does return all the items back into the view, however... from this point my undo stack are messed up and dont do things right. REDO doesn't even work from this point on.
I have also tried this with only deleting one item out of the workflow... and then undoing the delete... the error is still thrown.
So two issues:
1. why is the error happening.
2. why does my redo not function correctlty, aka at all?
Thanks for any help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是我是 willChange 和 didChange -undoManagerDidUndoOrRedo... 中的一些 KVO 值,这是当撤消管理器在该通知内完成撤消操作时触发的通知(撤消系统状态的内部)。 ..所以我错误地创建了一些嵌套更改...这弄乱了我的撤消堆栈。
The issue was that I was willChange and didChange some KVO values within the -undoManagerDidUndoOrRedo... and that is a notification that is triggered when the undo manager completes an undo operation, inside that notification (internal to the state of the undo system)... so I was creating some nested changes incorrectly... which messed up my undo stack.