Reputation: 2745
I have developed an iPhone app which stores photos in the /Documents
directory of my app.
I would like to add a feature which gives to the user the opportunity to transfer those pictures to his/her PC or Mac.
I don't really know how to do that. What is the best way, using Bonjour, bluetooth, or directly USB (if it is possible) ? I really need some advices on that point ...
Any ideas ?
PS: Forgive my English, I am French :-)
Upvotes: 3
Views: 2353
Reputation: 17762
Without knowing more about your specific application, I agree with Graham Lee--either directly saving to the Camera Roll or giving the user an option to save one or more photos to the Camera Roll is much simpler than http/bonjour.
Upvotes: 0
Reputation:
You've edited the question to say that it's about transferring photos. Could you store the photos on the iPhone's photo roll with UIImageWriteToSavedPhotosAlbum()
, and let Apple handle getting them onto the computer?
Upvotes: 2
Reputation: 34935
If you do not want to write a Mac or PC part for your app then you can also consider to build in a little http server that people can use to access the data in your app. There are some nice open source http servers available for Cocoa which you can find with Google.
Using Bonjour you can advertise your http server so that people can easily find it with a Bonjour enabled browser like Safari. (Your iPhone app's web server will appear automatically under the dynamic bonjour bookmarks items)
Upvotes: 3
Reputation:
Try NSNetService
to register the service in Bonjour, and NSFileHandle
to send data over a socket connection associated with the service.
Upvotes: 3
Reputation: 64428
Bonjour!
I mean that both as a greeting and an answer. You have to setup a bonjour connection over wifi to transfer files directly to and from an app. That's actually pretty simple to do on both the iPhone and Mac side. The PC is a little tougher.
You can do bluetooth but bluetooth capability is still fairly rare on desktops.
Upvotes: 1