Re: Rolling back sharedAddressBook changes
Re: Rolling back sharedAddressBook changes
- Subject: Re: Rolling back sharedAddressBook changes
- From: Vince DeMarco <email@hidden>
- Date: Fri, 23 Jan 2004 09:49:29 -0800
On Jan 23, 2004, at 9:14 AM, Dave Hersey wrote:
Hi,
If I make changes to the ABAddressBook's sharedAddressBook, and don't
want
those to stick, how do I revert? I'm surprised that there's not a
counterpart to ABAddressBook save like ABAddressBook discardChanges. I
couldn't find any info in the headers or docs about reverting the data
in
sharedAddressBook.
My situation is that I'm syncing to some web data, and the user can
cancel
during the processing. There can be thousands of entries, so it can
take a
little while to compare and change the appropriate data in the AB. The
"save" isn't done until the last thing, so I'd like to roll back if
the user
cancels before that.
What's the correct approach here?
There is no roll back. An approach would be to save the changes "in
memory" then apply them after being all done then save.
(Save them in a dictionary keyed by uniqueId of the ABPerson records
etc..)
Another approach would be to fork off a tool, (command line program)
that does all of this, then if it wants to "cancel" have the tool exit.
Hope that helps.
We really should have added a discardChanges call, please file a bug
requesting this.
vince
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.