Undo core data managed object

后端 未结 5 2115
野性不改
野性不改 2021-02-06 15:26

I have this code:

Store* store = [NSEntityDescription insertNewObjectForEntityForName:@\"Store\"];
store.name = @\"My Company\"
...

Now the sto

5条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-06 15:54

    Undo works only when I create a undoManager(Swift 5):

    managedObjectContext.undoManager = UndoManager()
    

    After this configuration you can undo a last change:

    managedObjectContext.undo()
    

提交回复
热议问题