Search code examples
iphonemacosxcode4itunes

iPhone Documents Folder how to move/copy from host to iphone?. confusing


1) I have a sqlite database .db in the host machine ie: mac. say: sample.db

2) I have a iPhone application which looks this sample.db in the Documents Folder.

3) I have a itune version of 10.6.3. Mac: Lion OS.

I just want to copy this sample.db to iPhone Documents Folder. How to do this?


Solution

  • You have to enable iTunes document sharing for your app first.

    To do this, set UIFileSharingEnabled to YES in your Info.plist. After running your app on the iOS device for the first time with this configuration option enabled, you will see the app in the iTunes file sharing view when the device is plugged in.

    You can now drag & drop your file onto the file sharing view in iTunes and it gets synced to the iOS device.