I've implemented an NSFetchedResultsController
correctly so that it splits up my fetched data by sections. When I try print out its property sectionIndexTitles
I just get "0"
, but if I iterate over its sections and print out the section names it prints out each section's name:
dump(fetchedResultsController.sectionIndexTitles)
// prints out "0"
var names = [String]()
for val in (fetchedResultsController.sections)! {
names.append(val.name)
}
dump(names)
// prints out: - "03/31/2017"
- "04/01/2017"
- "04/02/2017"
I thought the sectionIndexTitles
returns an array of all the sections' names, is that incorrect?