views:

62

answers:

1

When I add a section index consisting of "A", "B", ..., "Z" to my UITableView, everything works fine in the iPhone simulator. In this case, I get A, B, C,..., Z displayed in a horizontal line on the right hand side of my UITableview. If I add a 27th element (e.g. "Other") to the section index titles, the section index will now show A,* ,C ,* ,E,* ,H ,* ,J ,* ,L ,* ,N ,* ,P ,* ,R ,* ,U ,* ,W ,* ,Y ,Other ,* ,Other. Here * represents a circle that is rendered.

Any ideas as to why A,B,C,...,Z,Other is not displayed as I would expect?

Is there a maximum number of entries you can have in a section index?

If I've exceeded the maximum number of entries in the section index and the list gets compressed, why does "Other" show up twice in the compressed section index?

I get the following behavior when I press entries in the section index:
Press 1st Other: Title = Y, Index = 24 returned
Press last * : Title = Z, Index = 25 returned
Press 2nd other : Title = Other, Index = 26 returned

+2  A: 

Is there a maximum number of entries you can have in a section index?

Correct. Once you move beyond a certain number of entries in the index, the OS will automatically start condensing the list (and replacing with circles) so that you can see as much of the list as possible without requiring the user to scroll. The first time I saw this I was surprised, but it does make sense ... otherwise, the OS would need to resize the elements in the index, or force the end of the index off-screen, neither of which are usable solutions.

Hope this helps. Andrew

Andrew Little
Thanks Andrew. I was afraid this might be the case. I'm still puzzled about why "Other" shows up twice in the compressed index.
pirey4
yeah, not sure. If you want to see this same "condensed ist" behaviour, just start the iPhone's Contacts app and turn to landscape.
Andrew Little
Little, great example. I wish I would have noticed that before. It didn't have the last entry (the #) repeated twice though. :-)
pirey4