开发者

In which situations would I want to call -rollback in Core Data?

开发者 https://www.devze.com 2023-01-03 15:21 出处:网络
I try to grok this method. Is that only useful when I\'m dealing with undo/redo operations? Or can I use that in general, when I have changed my object graph after saving it and then decide开发者_运维

I try to grok this method. Is that only useful when I'm dealing with undo/redo operations? Or can I use that in general, when I have changed my object graph after saving it and then decide开发者_运维问答 that that was a bad idea? So -rollback would go back to the last saved state of my object graph?


"So -rollback would go back to the last saved state of my object graph?"

That's exactly it - "restores updated objects to their last committed values"

When you are performing multiple, or complex changes or alterations you may want to work on the managed objects directly but still allow a user a final chance to hit the "Cancel" button. That's one time you would use it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号