Is it possible to transfer files between a Mac app and a iOS app? I want to transfer files that are in the documents directory in my iOS App to my Mac App via Wifi, how could I do it?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Well, as of iOS 5 onwards, there's iCloud. Since that's still under NDA, I'll just have to point to the relevant documentation and let you read up on your own.
If not, I'd consider using the fabulous Dropbox APIs. This does require your users signing up for a Dropbox account, but then you get automatic two-way syncing between their Mac (or PC) and their iOS devices.
Failing that, there's always Bonjour. Properly configured - and it's not super easy, there is a bit of CFSocket or BSD socket work that you need to do - Bonjour will discover any services on the local network, Mac or iOS.