开发者

How can I make an SQLite database within an iPhone app available to the desktop?

My Android app stores its SQLite database on the SD card, so that when the phone is connected to a PC my desktop application can access it using an ODBC driver. Is a similar technique possible on the iPhone?

I know that iPhones do not have 开发者_如何学CSD cards.


I use iTunes file sharing to access sqlite DBs on both the iPhone and iMac; iTunes moves the data. Enabled in the plist


As it has been said, it can't be done.

However what you could do is to embed a small Web Server into your App, and let the users to download the DB ( or even visualize it ), via WiFi on their homes/work. This approach would work for Windows/Mac/Linux users, and several apps are already doing it this way.

Good luck!


Not built-in, unfortunately. You'll have to roll your own Wi-Fi syncing system. You could use iCloud when it comes out in the fall, but that only works on Macs for now.


SQLite is present in the iPhone SDK, but there's no way to flag a file stored by your application as being visible to the file system when you plug your iPhone into the computer. As stated already by Chris Long, Apple's answer to this criticism is iCloud, which allows you to do synchronisation between arbitrarily many devices without cables, but that isn't available yet. The iOS 5 beta is available to registered developers and is publicly known to function with iCloud, so you could start developing now.

More painful temporary alternatives are to email the database out (there's a supplied way to do in-app email) or to expect your user to drag and drop the thing out of iTunes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜