Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

rompelstilchen

macrumors newbie
Original poster
Dec 20, 2010
7
0
Hi everybody,

I've a (maybe dumb) question.

I want to manage a list of elements (small photo, name and category).
The user is able to manage (view, add, delete, edit) this list with a tableview.
The tableview is grouped (categories sorted) and sorted by name inside each categories.
The data come from a SQLlite DB.
Should I initiate my app with db and after try to work with array and dictionaries, and only write my db when my user quit (a lot of array filter and others).
Or can I work directly of the db for everything (populate my tableview, ...)

Thanks for any advices.
 
Hi everybody,

I've a (maybe dumb) question.

I want to manage a list of elements (small photo, name and category).
The user is able to manage (view, add, delete, edit) this list with a tableview.
The tableview is grouped (categories sorted) and sorted by name inside each categories.
The data come from a SQLlite DB.
Should I initiate my app with db and after try to work with array and dictionaries, and only write my db when my user quit (a lot of array filter and others).
Or can I work directly of the db for everything (populate my tableview, ...)

Thanks for any advices.

I would say go ahead and use the DB directly. Just make sure when populating a list you don't populate everything at once, (populate "pages" like the Mail app does.)
 
So it wont drain more battery (processing) using direct SQL Query against NSArray or NSDictionary.

Thanks for your answer.

If anybody has a counter opinion, feel free to share with reasons
++
 
You're certainly right..
I start writing my code before thinking, like an addict...
Now I've write everything by loading up my SQLlite, doing my job with Arrays and Dictionaries and write the change when memory warning or quit.
It start to be pretty annoying working with arrays for filtering and stuff like that.
Before re-writing, I was checking if anybody have already did this (right) choice...
++
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.