Get sectionIndex titles based on contact name
问题 In my app I have a db with 50k+ contacts. To display them on list view, I need to calculate the index section titles to display them on the right side. However my logic is taking time around 3-6 seconds to prepare the datasource. -(NSArray *)getSectionTitleBasedOn:(NSString*)sortBy{ for (RealmContact *contact in contactSource){ if (contact.firstName.length>0) { if ([sortBy isEqualToString:@"FirstName"]) { NSString *firName= [contact.firstName stringByReplacingOccurrencesOfString:@" "