`NSUndoManager` is a general-purpose recorder of operations for undo and redo.
Questions tagged [nsundomanager]
222 questions
4
votes
3 answers
Undo/redo with a UITextView (iOS/iPHone)
I have a view where a UITextView always has focus. What I want to do is extend the built-in undo/redo behavior to support undo/redo for when I programmatically set the text (e.g., for when I clear it, by setting it to @"").
Since only the…

Aral Balkan
- 5,981
- 3
- 21
- 24
4
votes
4 answers
Undo typing in UITextView
I'm using iPhone SDK 3.0.
Say, I enabled 'shake to undo' by setting application.applicationSupportsShakeToEdit to YES in my app delegate. I created an UITextView in RootViewController and had it become first responder upon app launch.
I use -…

Anh
- 6,523
- 7
- 46
- 59
4
votes
2 answers
UITextField replace text with NSUndoManager Support
I'm just using a simple
self.customerTextField.text = @"text";
but I would like there to be undo support, where if they shake the phone they can undo the change.
I'm kinda at a loss as to how to accomplish this. All the exapmles I find are for…

Hackmodford
- 3,901
- 4
- 35
- 78
4
votes
1 answer
Will NSUndoManager undo changes happening in the background?
I've got an edit view controller which I'm using an NSUndoManager for which is the one set for my persistence store (core data project).
One of the features of my app is synchronisation with an external server. What I want to know is, if I am…

PaReeOhNos
- 4,338
- 3
- 30
- 41
4
votes
1 answer
Core Data UndoManager sends weird NS
The app I'm working on lets users manage some assets. The user can create / delete / edit / split / move assets around on the screen. Users need to be able to undo all these steps back.
The assets are managed with core data (and yes, the undoManager…

user1712077
- 41
- 3
4
votes
3 answers
UITextView undo manager do not work with replacement attributed string (iOS 6)
iOS 6 has been updated to use UITextView for rich text editing (a UITextView now earns an attributedText property —which is stupidly non mutable—). Here is a question asked on iOS 6 Apple forum under NDA, that can be made public since iOS 6 is now…

Denis
- 775
- 7
- 22
4
votes
1 answer
Capturing undo and redo edit text groups in NSTextView
I'm writing a plugin for an existing app and I need to capture the modified text and range affected by the undo and redo action. I am able to access the NSUndoManager and NSTextView the app has created and I am able to register for notifications. Is…

afrederick
- 1,388
- 1
- 10
- 24
4
votes
3 answers
Core Data undoManager crashes
I am using the below code for a core data singleton. Below is my code. (based from NachoMan's blog. However the code is from his gist.
// DataManager.h
#import
#import
extern NSString * const…

Bot
- 11,868
- 11
- 75
- 131
3
votes
1 answer
Is there a better way to access the Document from its subviews?
I have some classes located on my Document such as NSNotificationCenter and NSUndoManager that I need access to from my subviews.
Right now I can access them by doing something like this:
NSUndoManager *undoManager = [[[[[self view] window]…

panupan
- 1,212
- 13
- 15
3
votes
2 answers
Undo/redo text input w/ SwiftUI TextEditor
Admittedly this is a broad question, but is it possible to undo or redo text input (via iOS's UndoManager?) when using a SwiftUI TextEditor control? I've looked everywhere and was unable to find any resource focusing on this workflow combination…

Barrrdi
- 902
- 13
- 33
3
votes
1 answer
Creating a continuously updating custom control with proper undo management
I am putting together a custom NSView that handles two values through bindings. I am propagating the values upon updates as outlined by Tom Dalling in the question Can you manually implement Cocoa bindings?. This all works fine.
In order to make the…

Gustav Larsson
- 8,199
- 3
- 31
- 51
3
votes
1 answer
Shake-to-undo working on CoreData app, but no undo/redo prompts shown
I have a CoreData based application which supports shake-to-undo. This is currently working fine, however when I shake the device, the undo happens immediately, without first showing the usual undo prompt which NSUndoManager normally provides for…

Andrew Ebling
- 10,175
- 10
- 58
- 75
3
votes
1 answer
redo does not work (ios swift undoManager, Invocation)
Using Swift 3.02 (Xcode 8.2) I refer to an undo-solution described in answer: https://stackoverflow.com/a/31450475/7448394.
In the code below I use this solution to test both undo and redo of a drawing.
When I press the button for randomDrawing it…

user7448394
- 31
- 5
3
votes
1 answer
core data: disable undo for specific attributes. Recommended approach not working
I have a textfield and a checkbox, backed by core data. Changes to the checkbox should be kept out of any undo/redo operations.
The recommend approach (found on stack overflow) is the following snippet.
@IBAction func stateDidChange(sender:…

user965972
- 2,489
- 2
- 23
- 39
3
votes
1 answer
How do I access the undoManager for my Mac OS app in swift?
I am simply trying to get undo working for the actions a user performs in my app. By default, any text editing the user does has the benefit of undo, but any actions that are done otherwise (from my code) does not.
I can see the documentation…

Subcreation
- 1,353
- 12
- 26