标签: iphone objective-c
我正在使用石英在我的视图中绘制图像,现在我想在myipad应用程序的工具栏按钮中添加撤消按钮。
什么是代码或执行此操作的任何示例。
答案 0 :(得分:2)
NSUndoManager自iPhone OS 3.0起可用
http://developer.apple.com/iphone/library/documentation/cocoa/reference/Foundation/Classes/NSUndoManager_Class/Reference/Reference.html
http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/UndoArchitecture/Articles/iPhoneUndo.html
答案 1 :(得分:0)
将旧状态存储在堆栈中。按下撤消按钮时,弹出堆栈并恢复状态。堆栈为空时禁用撤消按钮。小心不要耗尽内存。
什么构成“旧状态”可能非常特定于您的申请。