UA-17470720-3

Jump to content


Photo
- - - - -

sectionForSectionIndexTitle: not being called; Please help!

models

  • Please log in to reply
1 reply to this topic

#1 topify

topify

    Starting Out

  • STV 4.0 Pro
  • Pip
  • 1 posts
Reputation: 0
Neutral

Posted 15 May 2015 - 09:44 AM

Hello! I'm working on a tableview that includes the A-Z side index. However, the data I'm importing doesn't always have an entry for each letter in the alphabet. So I would like the A-Z index to function like so:

 

1. If there is a item for that letter in the index, say, "B", it should go to the first item in the "B" Section.

2. If there isn't an item for that index, say, "C", it should go to the letter before it, in this case, "B"

 

Currently, here is what happens: If I have sections for A, B, G, F, W, then the A-Z index will take me to A and B just fine, but

C => G,

D => F,

E and below => W

 

I know the problem is that the A-Z is taking me to the next index item. I figure I'll just implement one of the native UITableViewDataSourceDelegate calls, tableView:sectionForSectionIndexTitle:atIndex:

 

Unfortunately, when I implement the method, it is never called. HELP!

 

 

PS - This question has been asked in a similar way and left unanswered here: http://sensiblecocoa...extitleatindex/



#2 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 15 May 2015 - 01:59 PM

Hi topify,

 

Looks like the simplest solution is for us to create a new model action called 'sectionForSectionIndexTitle' in our next release (due in about a couple of weeks). If you can't wait for that, you can still implement "tableView:sectionForSectionIndexTitle:atIndex:" yourself by subclassing SCTableViewModel. You can find a code sample of subclassing SCTableViewModel in the following post: http://sensiblecocoa...ods/#entry12318

 

PS - Thanks a lot for pointing us to that post, I'll make sure it gets updated.







Also tagged with one or more of these keywords: models

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users