I am having trouble setting up my cellForRowAtIndexPath with Sections. If I were to just show all "tracks" without separations of sections by "topics" then it works fine.
Track *aTrack = [appDelegate.tracks objectAtIndex:row];
cell.textLabel.text = aTrack.track_title;
I have already set up my numberOfSectionsInTableView, numberOfRowsInSection, titleForHeaderInSection. Those all works fine. But I don't really know how to setup cellForRowAtIndexPath.
After researching some more the best way seems to use a NSDictionary to display my cells...
NSDictionary *dictionary = [sectionTopicArray objectAtIndex:indexPath.section];
NSArray *array = [dictionary objectForKey:@"Tracks"];
NSString *cellValue = [array objectAtIndex:indexPath.row];
cell.textLabel.text = cellValue;
Can someone give me some pointers on how to make a MutableArray(sectionTopicArray) that is gonna hold all my Dictionaries? I can see the following in my head but just don't know how to word it in code.
sectionTopicArray
[0] Dictionary 1 with key Tracks
Track1
Track2
Track3
[1] Dictionary 2 with key Tracks
Track4
[2] Dictionary 3 with key Tracks
Track5
Track6
basically I'm thinking...
Section0 = Dictionary1 = Topic1
Section1 = Dictionary2 = Topic2
Section2 = Dictionary3 = Topic3