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)
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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