I needed some advice on how to get the data from the database(sqlite). I am having a navigation based application. The db i have, contains a CONTACTS table.For each row in CONTACT, another table CONTACT_DETAILS contains around 50 rows.
The data from CONTACTS i have to load at application startup as i have to show them on the first page of application. Now about the CONTACT_DETAILS, here i am a little confused about how to load the data from the database.
Shall i load all at once on application load? Or
Shall i load this data only on selection of a particular contact?
views:
24answers:
1
A:
Short answer: use CoreData and you wouldn't have to worry about it.
Slightly longer answer: it depends (ok, that was shorter). If your database is small and you aren't going to update it, you might just as well load it at launch; but if you are updating or it is larger, load the details when you call the view controller from the master - typically in the viewDidLoad
(or viewWillAppear
, again, depending).
Paul Lynch
2010-04-29 15:52:58