Question

I'm trying to figure out to store a reference to an ABPerson in a Core Data store on an iPhone app. Ultimately, I'd like to be able to sync with a Mac version of the app (I'm assuming ABRecordIDs wouldn't be the same for the iPhone and the Mac). I was thinking of storing the record ID, name, and email and checking against those--is there a better way?

Was it helpful?

Solution

It kind of sounds like you're attempting to out-guess or re-do the syncing functionality Apple's already implemented. Can you describe exactly what you mean by "sync with a Mac version of the app"?

If you're asking for a better way to store the information about an ABPerson to make it easy to recover the next app launch, there is a property in ABPerson, kABUIDProperty, which will give you a unique identifier for the record that is guaranteed not to change. I used something similar with an app that uses the Media Player Framework to identify exact songs between launches.

OTHER TIPS

You can use kABPersonCreationDateProperty instead of kABUIDProperty, which is available in iOS.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top