English 中文(简体)
iPhone SDK: phone to phone file transfer
原标题:

What is the simpliest approach to copy files from iPhone to iPhone (p2p).

The only way I can come up is this:

  • Use Bonjour to discover server app (which will advertize itself via Bonjour)

  • Use NSStream (or sockets) and then stream data from the file from peer to peer (read chunk of the file, send chunk of the file and so on until entire file is read)

Is there a APIs/Method which would take care of all streaming data and just copy a file from place to place without doing low lever programming with streams or sockets (similar to http://msdn.microsoft.com/en-us/library/ms740565(VS.85).aspx)?

I guess I can also use GameKit and stream data over establish session, but it seems that Baonjour provides more flexibility.

thanks

问题回答

iFiles App (http://itunes.apple.com/us/app/ifiles/id336683524?mt=8) does in other way too, user can transfer files using browser from desktop to iPhone. So they used simple, html,js for this. But if iPhone to iPhone file transfer is considered then its app to app specific communication, which means we need to code it in low level, taking care of streaming and every thing. because in iphone you cannot choose files like desktop :)





相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签