当前位置: 动力学知识库 > 问答 > 编程问答 >

objective c - Data Exchange between same iPhone App on separate devices

问题描述:

I am developing an app on iphone that lets user take photos, add comments & GPS location to it and send it as an email to another user.

If the recipient has installed the same app & when she clicks on the attachment the same app will launch & parse these details & show them to the recipient. (I intend to use UIDocumentInteractionController for some of the stuff here)

Problem: whats the best way to encode this data in a single file & then retrive it upon arrival from the email.

网友答案:

This is pretty high level, but here are the general steps:

First, register your own file type as described here.

Then, archive your data using NSKeyedArchiver.

Next, attach it to an email using MFMailComposeViewController. Make sure you give it a filename that matches the file type you registered earlier.

Finally, implement application:didFinishLaunchingWithOptions: to handle the case when a user tries to open your email attachment. (Currently, it's the fourth bullet in the method documentation.)

分享给朋友:
您可能感兴趣的文章:
随机阅读: