I’ve tried NSMutableDictionary however I don’t seem to be able to get an object by index.
Any ideas?
EDIT:
I’ve trying to create a uitableview sections object, which will store the header titles and be able to increment a counter for the rows. I need to be able to get the counter by index, counter value by title value.
Simplest way is to use 2 collections: dictionary for section infos (row numbers, countries etc) and array for section titles.
When you need a section info by sectionTitle:
When you need a section info by sectionIndex:
When you add a section, add sections info:
and a title to array, so infos and titles will be in sync.
UPDATE: if the only info needed for section is number of rows:
UPDATE2: added types.
Rows count by sectionTitle:
Rows count by sectionIndex:
Adding a section: