I have two custom objects, "Phrase Book" and "Phrase", the Phrase Book has an array of phrases, and each phrase has a Title, Description (and a whole lot of other properties / methods). In otherwords:
PhraseBook.Phrases (NSArray) =>
Phrase (Subclass of NSObject) {
Phrase.Title = "Phrase Title",
Phrase.Description = "Phrase Description"
},
Phrase (Subclass of NSObject) {
Phrase.Title = "Phrase Title",
Phrase.Description = "Phrase Description"
}
I need to get this into a UITableView, sorted Alphabetically by phrase title with section headers. For which I need "numberOfSectionsInTableView", "numberOfRowsInSection", "titleForHeaderInSection", "cellForRowAtIndexPath(row,section)"
I started to build custom functions to sort all the objects alphabetically into another array, do counts on all the letters, (i was actually doing this by creating an nsdictionary with a key for every letter of the alphabet, adding to the array assosciated with it, and then deleting any keys that had an array with the length of 0).
Those functions are fine, but they feel like they are doing alot of grunt work for what seems like it should be quite simple. Thoughts? :)