Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What data structure to use / data persistence

I have an app where I need one table of information with the following fields:

field 1 - int or char
field 2 - string (max 10 char)
field 3 - string (max 20 char)
field 4 - float

I need the program to filter on field 1 based upon a segmented control and select a field 2 from a picker. From this data I need to look up field 4 to use in a calculation. Total records will be about 200. I never see it going above 400 - 500. I am going to use a singleton which I am able to code, I just need help with the structure for this data persistence.

What type of data structure should I use for this? Should I use NSNumber, NSString, etc. or old data types like float, Char, etc? I thought about a struct put into an array but there is probably a better way. This is new to me so any help or reference to examples would be great. I also thought about a plist or dictionary but it looks like it is just a lookup and a field which obviously won't work. Core data looked like overkill to me. Also, any recommendations regarding how I get initial data into it? I want the user to be able to edit and add to the database.

like image 893
Dave Avatar asked May 03 '10 03:05

Dave


1 Answers

Core Data isn't really "overkill" - this is exactly the kind of thing it's designed to do for you. You might be used to "databases" being expensive and heavyweight, but Core Data is built on sqlite, which is super tiny and fast. Trust me, it won't be a problem for your case.

like image 106
apenwarr Avatar answered Oct 19 '22 05:10

apenwarr