UITableViewIndex Grows to Incorrect Bounds Unexpectedly

Posted by chadburggraf on Stack Overflow See other posts from Stack Overflow or by chadburggraf
Published on 2010-04-21T02:59:05Z Indexed on 2010/04/21 3:03 UTC
Read the original article Hit count: 256

Filed under:
|

I have a standard UITableView + UISearchDisplayController + UITableViewIndex setup. Everything works like a champ.

Except, under very specific conditions, the index grows too long to display on the screen. Specifically, after ending a search and re-displaying the unfiltered, indexed table, the index sometimes grows too long.

More specifically, this doesn't happen if I search then cancel. It only happens if I search, then push a view controller from the search table, then pop that view controller back to the still-searching table, then cancel the search, then re-search and then cancel that final search. After the end of the final search the index is too long.

In portrait, the table view is reporting a height of 416 and the index a height of 404 under normal conditions. If I log from searchDisplayControllerDidEndSearch when the index is sized incorrectly, it is reporting a height of 620.

I've tried everything from setLayout on the table and the index to manually re-sizing the frame. Nothing works (the manual re-size causes the correct height to be logged, but it doesn't change the display on screen).

I was about to try re-sizing after a delay in case the cancel animation was interfering, but then I realized what an absurd situation I'm in and thought seeking help might be wise...

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uitableview