I'm trying to create a data structure for three fields. One method can grab two fields from a sqlite database. Another method grabs data using the two fields from another sqlite database. What is a good way to store the data? The three fields I need are of type:
NSString, key: @"Name"
NSInteger, key: @"ID"
NSArray, key: @"Info"
I thought I would do an array of dictionaries. So in the first method, I get the NSString and NSInteger, create a dictionary, and create an array of those dictionaries out of it. Then I got stuck thinking how I even print out the data for a NSMutableDictionary with two keys (question #1).
Then the second thing I thought was, can I then use the Name, ID fields to get the other piece of data from another table, and add a new key/value pair into the dictionary. I wasn't sure if that could be done (question #2).
And I didn't know if there was just a better way to approach this with a different data structure (question #3).
Thanks!
descriptionto do a "diagnostic dump" of the whole structure, but if you want to print things in a nice, defined format you need write the logic to do it. Basically no more difficult with NSDictionarys/NSArrays that with regular C-style structures, though.