How does undo/redo basically work on iPhone OS?

iPhone OS 3.0 brought over the concept of NSUndoManager from the Mac, which is what enables undo on the iPhone. NSUndoManager maintains a stack of NSInvocations which are the opposite actions to any edits or other changes you make. For example, – (void)observeValueForKeyPath:(NSString*)keyPath ofObject:(id)object change:(NSDictionary*)change context:(void*)context { NSUndoManager *undo = [self undoManager]; // Grab the … Read more

NSInvocation for Dummies?

According to Apple’s NSInvocation class reference: An NSInvocation is an Objective-C message rendered static, that is, it is an action turned into an object. And, in a little more detail: The concept of messages is central to the objective-c philosophy. Any time you call a method, or access a variable of some object, you are … Read more