Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Address Book contacts in Core Data

What’s considered ‘best practice’ when saving Address Book contacts in Core Data?

I’m writing an iPhone App, based on Core Data, where I need to save and recall Address Book contacts as part of the data model.

In the UI I plan to present a screen where the user can pick a contact from the current Address Book, create a new contact to store in the Address Book, or just create a ‘one-off’ contact with no saved record, local to the App only. These contacts are tracked in the context of the orders they have made, and not all contacts will require saving outside the App itself.

It feels ‘wrong’ to copy the data from the Address Book if using an existing entry, but not sure what to do if an Address Book record is edited or deleted.

I only need to track name and photo for the purposes of the App, so gut-reaction is to store the ABRecordID, and—because these can apparently change(!)—the first and last name, and only update local record if it’s updated (how to track that?).

Or can you store a ABRecordRef directly? (I imagine they aren’t persistent?)

I’ve done some searching on Google, and here, but can’t find any code samples or discussion on the integration of Core Data and Address Book in this manner; just lots of stuff on each in isolation.

Any one with some experience/gotchas on this subject point them out, or point me in the direction of some more reading?

Thanks.

Andy W

like image 784
creednmd Avatar asked Feb 23 '10 18:02

creednmd


People also ask

How do party records interact with the address book?

The following illustration shows how party records, party roles, locations, and transactions interact and relate to an address book. As the illustration shows, a party record can belong to one or more address books. Each party record can store one or more locations, or addresses, and is assigned a party role.

What is a global address book?

The global address book can help you understand the relationships among people and organizations that are associated with your organization. For example, a customer may also be a vendor in a marketing campaign, or a worker in your organization may also be a vendor.

When will the party and global address book functionality be available?

The party and global address book functionality was part of the dual-write orchestration solution when it was released for preview in January and February 2021. Based on customer feedback, the functionality was released for General Availability as a separate solution.

How do I create a customer address in CDs for applications?

Type the state or province of the customer's address. The attribute value may be set to NULL. the unique name that identifies this object in CDS for Applications. the column number for an attribute with an entity in CDS for Applications. Type the county for the customer's address. Type the county for the customer's address.


1 Answers

I would store the ABRecordID and then handle the situation for when they change although I have not personally seen a case where they change except when the user deletes all data and restores it from another source (moving from MobileMe to Google for example).

like image 86
Marcus S. Zarra Avatar answered Oct 15 '22 18:10

Marcus S. Zarra