tags:

views:

32

answers:

2

My project is similar to:

Users search the name of a medicine from a table. Then touch the medicine he/she looked for . Then prospectus of that medicine will appear on the view... How should I keep prospectus of medicine?(prospectus of a medicine consists of several lines of text) SQLite or NSDictionary thing... I thought that NSDictionary will not go well with my need... Any answers ???

A: 

I'd definitely go with SQLite. It can handle the data amount of Firefox and Thunderbird, so it should work for this, too.

For storing that information I see two ways: you extend the medicine table with e TEXT field which contains the additional information, or you create a 'linked' table which contains the id of the medicine and the information.

Bobby
Actually no.. Now, I have simply an array to hold medicines. I display them on TableView.. I just wanted to learn the structure to extend medicines to appropriate prospectus... But a prospectus consists of several lines of plaintext. How can I achieve to hold those texts???
A: 

SQLite offers a TEXT type which can store text, so that would work for simple text (with basic formatting, i.e. HTML or plain text with newlines).

Using SQLite to store the metadata (the name of the medicine) and then use another database to store the text will always cause problems with updates: You must make sure that both databases are in the same state. Imagine you're changing something and one of them reports an error. What are you going to do?

Aaron Digulla