Индекс UITableView без увеличительного стекла - PullRequest
1 голос
/ 18 сентября 2011

Я пытаюсь создать Indexed UITableView без значка увеличительного стекла. Я понимаю, что UITableViewIndexSearch создает значок в индексе, но я не знаю, чем его заменить. Буду очень признателен за любую помощь или предложения.

- (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];}

Ответы [ 2 ]

4 голосов
/ 18 сентября 2011

Просто замените его ничем.Просто оставьте константу UITableViewIndexSearch в вашем массиве.

2 голосов
/ 18 сентября 2011

Не добавляйте UITableViewIndexSearch в sectionIndexTitlesForTableView:.Просто верните массив из вашего fetchedResultsController.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...