简体   繁体   中英

How to transfer NSdata from one iphone to another

How can I go about transferring a NSData object from 1 iphone to another? (It is an audio which I am looking to play out of iphone #2)

Of course there are various ways to achieve this.

My suggestion would be to look at Apple's GameKit library. This makes it trivial to establish a connection to another iOS device. You may connect via Bluetooth or Wifi (if all you need to do is 'trigger' a sound that already exists in the application bundle on both devices, bluetooth will work fine - if you actually need to transfer a sound file, you probably want to use a Wifi connection). You will have to implement the actual transmission mechanism/protocol yourself in either case.

Another option is to use Bonjour and pass your data over TCP/IP.

You may find this tutorial helpful: Networking and Bonjour on iPhone

You could use the GameKit framework, you can use bluetooth to send data between iOS devices. Take a look at the Game Kit Programming Guide .

选项:1。Gamekit Framework 2.查看开源应用程序“Bump”

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM