I am recently making an app which needs to exchange messages between different iOS devices.I decide to use mail to do with the data transfer.And I read a tutorial by Ray( http://www.raywenderlich.com/1948/how-integrate-itunes-file-sharing-with-your-ios-app ) .It tells a way to handle this thing.But my situation is that the data I want to transfer are all stored in the sqlite.I think it's better to convert these data into NSString and than send them.But I have no idea of how to define custom UTI which will specify the specific type,like .myapp which will be sent to the receiver,and how to user can open it and import data in the app.Because I use iOS5,so I can't even follow the steps in the tutorial.By now,i can send email to users with the data,but not with the .myapp attachment.So , can anyone give any advice on how to get the data into .myapp file and how the receiver will get data and import it in the app,specially for iOS5?Great thanks.
2 Answers
I successfully made this work via Email by simply constructing a text file in CSV format (comma separated values) to be attached to the email message. I registered the .csv with my app, added an import handler, and now one can then open the file on the other iOS device running the same app.
However, I found this approach rather clumsy and not very user friendly. Have you considered using the Dropbox API instead? Even better, use the new iCloud interface right built right into the SDK. That seems so much more convenient from the user's perspective.

- 79,884
- 17
- 117
- 140
-
ICloud is a solution only if the devices all run under the same iCloud-Account in my understanding, isn't it? Or is it possible to share Data to "public" from iCloud storage? – MadMaxAPP Nov 20 '11 at 09:23
-
Don't use CSV. JSON is ideal for this if the OP really needs to mail data around. It is VERY easy to turn a [Core Data model into JSON](http://stackoverflow.com/questions/2362323/json-and-core-data-on-the-iphone/2363996#2363996). – Marcus S. Zarra Nov 21 '11 at 20:00
Another approach could be to send the data to a webservice which informs the receiver by notification (Apple Push Service Notification). Your data is then stored on a central system and can be loaded by the app as soon as the receiver gets the notification and opens the app.

- 1,035
- 2
- 16
- 39