Search code examples
iosobjective-ciphonetableviewstore

Best way to store table view elements?


I have a hierarchy like so -> Days (Table) -> Time (Table) -> Info (View).

Would it be better to store the information as a NSDictionary, with the Days as the keys and the Time as an NSArray for each key, or the Days as NSArray, with another NSArray for Time?

Key things to note:

  1. I'd like the sort the days and Time.
  2. I would be able to delete some Time data within the NSArray if I wanted to.

Solution

  • If you are going to delete or replace elements in an array you must use the mutable versions, NSMutableArray and NSMutableDictionary. I would probably use an array for this purpose.