Hi everyone,
I am having problems with a tableView in a project I am working on. The data loads into the table perfectly at first, but when I scroll to see the remaining data, the NSMutableArray that I am using has the correct number of elements, however it is filled with invalid data (its an array of objects).
Heres how I define the array in the view controller's .h file:
If I set a breakpoint on the code in cellForRowAtIndexPath, i can see that the appts array has 9 objects, but the properties are invalid for every object.
What am I doing wrong?
In what way is the data invalid? Is the data itself incorrect, or is what you see in the table incorrect?
I agree. Too many things can go wrong. I tried to be as generic as I can.
after scrolling up when debugging with a breakpoint set, I can see that the array has the correct number of elements, and they are all Appointments objects, but the object's properties are invalid. not blank, nill or any other real value. Its like the object is there, but its not initialized.
Initially, when the tableView loads, the data shows perfectly, and I am able to push to a detail view as well.
Last edited by agnos5; 12-15-2009 at 03:11 PM.
Reason: clarity
If the initial display is correct, that suggests the issue is with getCellContentView.
However, add some log messages to make sure that each of your various data elements is correct before assigning them to the labels.
getCellContentView is not the problem, i am simply adding labels to the contentView of the cells to display the data. I can post that if you like, but theres nothing else involved.
Well, you either have a data problem or a display problem.
If it is a data problem, log messages should help to reveal that. Add them and see what they say.
If it is a display problem, the only atypical thing I see here is getCellContentView. I'd be curious to see what you're doing there, since the name sounds awkward. Cell vs. content view is an important distinction.