`NSUndoManager` is a general-purpose recorder of operations for undo and redo.
Questions tagged [nsundomanager]
222 questions
3
votes
1 answer
Serialize state data from NSUndoManager on iPhone
I've got undo/redo set up in my iphone app, and now I'm looking at saving state, so when the user exits the app and then starts it up again, everything is in the same state, including the undo/redo stack. I don't see any obvious way to serialize the…

Silromen
- 1,131
- 2
- 10
- 18
3
votes
1 answer
Should I use a model object as NSUndoManager's target?
I have questions about the NSUndoManager methods
registerUndoWithTarget:selector:object:
prepareWithInvocationTarget:
Usually in examples, the "target" is a controller object that manages all the model objects (usually in an array).
But can the…

dan-3
- 73
- 3
3
votes
1 answer
UndoManager and multiple MOC
I have 3 MOC.
MainThread MOC to display stuff (with undomanager)
Background-save MOC to save data to disc (connected to store)
Backgorund-update MOC to download data from server, parse it and save later
They are parent-child…

Grzegorz Krukowski
- 18,081
- 5
- 50
- 71
3
votes
2 answers
Undo CoreData changes with 2 chained ManagedObjectContext application
I'm working on an app where user can edit some entries manually, but they can be updated from server as well.
For user updates I'm using UndoManager to allow user to cancel / confirm group of changes. When user enters edit mode I'm doing:
//when…

Grzegorz Krukowski
- 18,081
- 5
- 50
- 71
3
votes
1 answer
NSUndoManager and GLKit
I'm trying to support undo/redo in an iOS app that uses GLKit.
When I try the following:
GLKVector3 currentTranslation = _panningObject.translation;
[[self.undoManager prepareWithInvocationTarget:_panningObject]…

Tom Irving
- 10,041
- 6
- 47
- 63
3
votes
1 answer
NSUndoManager : separate multiple changes in one run loop cycle
I'm using [undoManager registerUndoWithTarget::] to add some changes to undo stack.
However, sometimes happens, when in one run loop cycle two changes added to the same group, so they are reverted at once, which is not behavior I'd like to have.
I…

Nickolay Olshevsky
- 13,706
- 1
- 34
- 48
3
votes
1 answer
Undoing Clipboard Text with NSManager
I'm implementing NSUndoManager with a UITextView control. If I want to undo the last text change, I can do it with
// NSUndoManager *myUndoManager; Declared in the header
if (myUndoManager.canUndo) {
[myUndoManager undo];
}
That's quite…

El Tomato
- 6,479
- 6
- 46
- 75
3
votes
1 answer
Auto-save not working with NSUndoManager on UIManagedDocument
Resolution
NSUndoManager must only be used in a child NSManagedObjectContext (when used with Core Data). This is because the UIManagedDocument may auto-save at any point in time, after which an undo will have no effect. Therefore there is no point…

Michael
- 8,891
- 3
- 29
- 42
3
votes
0 answers
Undoing changes in Core Data when changes are always done in temporary child contexts
My Mac application is setup to always do changes to its models off the main thread as follows:
make changes in a separate thread (with its own context)
save in the background, which pushes changes to the parent context in the main
thread
post a…

jprabawa
- 51
- 4
3
votes
1 answer
NSUndoManager with blocks
Of all the things that I would expect to support blocks, NSUndoManager curiously does not seem to do so. Is there some inherent reason for this, or has Apple simply not gotten around to modernizing this bit of API?
In particular I would like to…

justin k.
- 504
- 1
- 6
- 15
3
votes
2 answers
Undo Manager is nil --- Why?
Why is [self undoManager] zero in a child window, in a doc-based app?
Should it not refer to the undo manager of its parent window? In the parent window, I get an actual address for the undo manager!

Carelinkz
- 936
- 8
- 27
3
votes
1 answer
NSManagedObjectContext: undo save-operation?
I'd like to undo a save-operation on my NSManagedObjectContext; I always thought, that's what the NSUndoManager is for, but it seems as if undoing over a save-operation doesn't work...
An example:
[[NSManagedObjectContext MR_contextForCurrentThread]…

swalkner
- 16,679
- 31
- 123
- 210
2
votes
0 answers
Core Data and NSUndoManager - Deletion/Insertion order with undo
I have an image made up of multiple layers (managed object), each represented by a view. When I clear these layers, I delete them from front to back, expecting the undo to restore them in opposite order, back to front, therefore creating their views…

Philippe Sabourin
- 8,066
- 3
- 31
- 46
2
votes
1 answer
detecting when NSUndoManager's alert view is visible
I'm going to describe what I'm trying to do generally (in case there's a better way) and then the stumbling block I've run into (in case my way is the best way).
What I want to do: I want to add an invocation to my undo manager that has a time…

kevboh
- 5,207
- 5
- 38
- 54
2
votes
1 answer
How do I make UITextView use its parent's undoManager instead of its own
I have a UIViewController that has a PKCanvasView and several UITextViews as its subviews. I need to unify all of these views' undo managers, so I can control them as a single undo stack from my view controller.
I can already do this with…

Hamster
- 133
- 3
- 12