superM
superM

Reputation: 8695

iphone tableview scrolling issue

I have a tableview with imageviews and textviews in each cell. When my view is loaded one of the textviews is invisible. But when I start scrolling the textview appears, so that my view looks as it is supposed to look. Does anyone know why this is happening? P.S. I have read about reusing cells when scrolling so I have been very careful to construct my cells correctly.

Upvotes: 0

Views: 153

Answers (1)

DBD
DBD

Reputation: 23213

Without code, no one can give you a exact answer. But for a guess....

Is your data is getting populated after your table call cellForRowAtIndexPath? When the cell populates the first time, no data, so the cell is in it's unformatted state. By the time you can interact with the table and scroll it off and on screen (which calls cellForRowAtIndexPath again), the data has been populated and so the cell looks as expected.

You can test this by putting a breakpoint in your cellForRowAtIndexPath method and check to see if your data objects are initialized or still set to nil.

Upvotes: 1

Related Questions