开发者

download database to iphone

The app I'm writing needs to get information from a remote database and then store it in the SQlite database on the iphone for offline use. As of now I'm using a php script to query the database a开发者_StackOverflow社区nd then just basically scrapping the html data from the php echo calls.

My problem is that now that I'm moving away from test data I'm using database tables that are fairly large with complex dependencies. I would really like to not to have to write a parser for these complex files to manually put the data and dependencies into the iphone database.

My question is if there is any way to use a php script to pass to the iphone a copy the actual database file and then just dump that into the SQlite database on the iphone.


While I'm not familiar with iphone development, it seems to me that you ought to be able to just construct the sqlite database file on the server, and then send it to the device (or have the device pull it down). Of course, this is only efficient if you need to send the whole database every time.

If you need to do things more incrementally (you're just adding some new data to the device's database) why not just have PHP write out SQL statements to make any necessary changes, send those to the device, and have the app execute them?


Make the serverss response XML and bring it into core data that way.

http://code.google.com/p/touchcode/wiki/TouchXML will help you parse the response.

You could also make the server send its response in JSON and use this library, http://code.google.com/p/touchcode/wiki/TouchJSON

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜