views:

119

answers:

2

Hi all,

I have a Core Data-based app that keeps records of purchase receipts, and I'd like to know if I can send one specific record (i.e., one row from the SQLite table) from one phone to another via email or whatever. I'd like to have a button that says "send a copy of this receipt to so-and-so" that would email the record that could then be imported. These are very small records that have less than 20 rows.

I know that this has been asked before (http://stackoverflow.com/questions/2040784/core-data-store-sharing-between-iphone-apps), but I'm wondering if anyone who has actually implemented this could share an approach.

Thanks!

A: 

If the length of the record you wish to send is no more than 95 Kb, then you may take advantage of GameKit and export/import it using a P2P connection. I do this in one of my apps using Bluetooth as the underlying connection. Otherwise, large records may be handled by a bonjour client/server implementation. Again, this is commonly done when synchronizing data with a desktop application.

unforgiven
A: 

In this case, by far the easiest approach is to write a serialization/deserialization method for your entity. I would suggest using a plist with an application-specific extension. You can then load the plist in your recipient and deserialize into the client's managed object context.

Barry Wark