I am tryin开发者_如何学Gog to create an Indexed UITableView with out the magnifying glass icon. I realize the UITableViewIndexSearch is creating the icon in the index but I do not know what to replace it with. Any help or suggestions would be greatly appreciated.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return [[self.fetchedResultsController sections] count];}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
id <NSFetchedResultsSectionInfo> sectionInfo = [[self.fetchedResultsController sections] objectAtIndex:section];
return [sectionInfo numberOfObjects];}
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index {
return index;}
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView {
// Return the array of section index titles
NSArray *searchArray = [NSArray arrayWithObject:UITableViewIndexSearch];
return [searchArray arrayByAddingObjectsFromArray:self.fetchedResultsController.sectionIndexTitles];}
Simply replace it with nothing. Just leave the UITableViewIndexSearch
constant out of your array.
Don't add UITableViewIndexSearch
in sectionIndexTitlesForTableView:
. Simply return the array from your fetchedResultsController.
精彩评论