开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜