• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Rolling back sharedAddressBook changes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Rolling back sharedAddressBook changes (From: Dave Hersey <email@hidden>)

  • Prev by Date: Re: AppleScripting of Cocoa Applications
  • Next by Date: Detecting time zone changes
  • Previous by thread: Rolling back sharedAddressBook changes
  • Next by thread: NSXMLParserTroubles (errors and line/column positions wrong?)
  • Index(es):
    • Date
    • Thread