UITableview controls text are not loaded when goes visible off on scrolling

Im new to IPhone world. I have developed sample app using UITableviewcontroller + UIToolbar.

Problem is when cells goes visible off while scrolling that cell values are also cleared

for example: UITableview have the following items. (internally each item have some integer value for calculation)

Item1 text

Item2 text

Item3 text

Item4 text

Item4 text

Item5 text

When i scroll the tableview, item1 and item2 goes off from visible

Now i try to calculate tableview values, i missed the text of item1 and item2

Help me out of this

Thanks in advance, Nagarajan Govindarajan.

Upvotes: 0

Views: 108

Answers (1)

rckoenes
rckoenes

Reputation: 69499

Only visible cell are kept in memory. You Should not use the cell to keep track of any values.

Use the UITableViewDataSource to keep track of any of the values. Use for instance a NSArray hold your itmes. Then in the methods of UITableViewDataSource you can retrieve the value from the NSArray and pass it to the UITableView which will display it.

Upvotes: 2

Related Questions