Index Titles

The fetched results controller’s sectionIndexTitles property generates a list of section titles from the sections within the fetched data. For Recipe 12-1, that array includes single-letter titles. The default implementation uses the value of each section key to return a list of all known sections.

Two further instance methods, sectionIndexTitleForSectionName: and sectionForSectionIndexTitle:atIndex:, provide section title lookup features. The first returns a title for a section name. The second looks up a section via its title. Override these to use section titles that do not match the data stored in the section name key.

Get The Core iOS Developer’s Cookbook, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.