开发者

UITableView Index without magnifying glass

开发者 https://www.devze.com 2023-04-06 04:35 出处:网络
I am tryin开发者_如何学Gog to create an Indexed UITableView with out the magnifying glass icon.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号