What data structure to use / data persistence
Posted
by Dave
on Stack Overflow
See other posts from Stack Overflow
or by Dave
Published on 2010-05-03T03:38:37Z
Indexed on
2010/05/03
3:48 UTC
Read the original article
Hit count: 368
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 go above 400 - 500. I am going to use a singleton which I am able to do, I just need help with the structure for this with data persistence.
What type of data structure should I use for this and 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, with any recommendation how should I get initial data into it? I want the user to be able to edit and add to the database.
Sorry for the old terms, you can see what generation I am from... Thanks in advance!!!!
© Stack Overflow or respective owner