UA-17470720-3

Jump to content


Photo
- - - - -

How to implement a table with selectable index


  • Please log in to reply
No replies to this topic

#1 agreensh

agreensh

    Starting Out

  • STV Lite
  • Pip
  • 2 posts
Reputation: 0
Neutral

Posted 16 May 2014 - 04:42 AM

Hi,

 

I have had no success in doing this.

I only get one index entry, which is 'S', and selecting it goes to the start of the list.

 

Can anyone help ?

 

self.tableViewModel = [SCTableViewModel modelWithTableView:self.tableView];

self.tableViewModel.autoSortSections = YES;

self.tableViewModel.autoGenerateSectionIndexTitles = YES;

    

self.tableViewModel.modelActions.sectionHeaderTitleForItem = ^NSString*(SCArrayOfItemsModel *itemsModel, NSObject *item, NSUInteger itemIndex)

{

    NSString *sectionTitle = (NSString *)item;

    return [[sectionTitle substringToIndex:1] uppercaseStringWithLocale:[NSLocale systemLocale]];

};






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users