문제

I am trying to grab the data from the database and display all the values in sorted order grouped into sections from A-Z and also my UITableView is indexed. In this case the indexes are A-Z. The strange thing that's happening is when I get all the values from the DB onto the table, I see that values under section 'B' has some values from section 'A' and if I tap on any index for example if I tap on index 'D' and come back to letter 'B' section the values that used to start with A are now replaced with D.

This happens only to section 'B' values in particular. All the values in other sections are displayed correctly. Sorry if the question is not clear. This is the best way I thought that I can describe my problem.

Please I need your help. It is very urgent to finish off this task and I can't understand why this is happening.

도움이 되었습니까?

해결책

Look at the TableView Suite sample code. There's a little thing called "cell reuse" that you are running into, and you'll want to clear that up before you continue on with this problem. It's the most frustrating thing to deal with with respect to tableviews if you are not familiar with it, but it's a memory use optimization that makes sense once you understand what's going on.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top