开发者

Question regarding ideal database implementation for iPhone app

So I have a question about the ideal setup for an app I am getting ready to build. The app is basically going to be a memorization tool and I already have an sqlite database full of content that I will be using for the app.

The user will navigate through the contents of the database(using the uipickerview), and select something for memorization. If that row or cell of data is selected, it is put into a pool or a uitableview that is dedicated to showing which items you have in your "need to memorize" pool. When you go to that tableview, you can select the row, and the actual da开发者_StackOverflowta would be populated. All information in the tableview would be deletable, in the event that they don't want it there anymore...

Thats it.

I know that with database interfacing, there are a few different options out there, in this particular setup, is core data the easiest approach? Is there any other way that would be better? I am just kind of looking for a point in the right direction, any help is greatly appreciated!!


Core Data is going to be the easiest. You will want to migrate your data from your raw SQLite file to a Core Data generated SQLite file as Core Data is designed to manage its own file 100%. Fortunately you can do this with a quick command line app on the desktop and then copy the resulting Core Data Sqlite file into your application bundle for later use on iOS.

Doing raw SQLite on iOS is possible but a real headache to get right compared to the ease of use that Core Data offers.

Update

Core Data on iOS produces identical files to Core Data on the Desktop. Therefore you can develop a quick and easy app for the desktop that say for example takes the following inputs:

  • Table/Entity Name
  • CSV of a row of data

Then it would create a Core Data entity based on the entity name and insert the data into that row.

With that in place it would be trivial to do a bash script to loop through the all of the tables and the rows in those tables to create your new SQLite file.

Hmmm, might have to do a blog post some time on CIMGF about this :)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜