I am getting an application crash from code that creates a tableView and then mixes rows that contain text labels with rows that contain switches. I've crashed it in various combinations (here is one example where the text is on the top rows and switches later, but I've also seen it when I reverse this or mix up the rows), but it works fine when I have all labels or all switches. The crash happens when I scroll down to a later row.
Any thoughts whats going on? What I'm doing wrong? Any reasonable way to get this bug looked at? Any reasonable way to work around this problem?
2 Answers
Accepted Answer
Hi there,
I see that you haven't set unique class names for rows, without it you're likely to get very weird results. since you have an conditional for adding a switch I suggest you re-jig it a bit so that you create the row in the same if segment as it's contents - you can then ensure it has the appropriate classname (i.e. 'switch' 'noSwitch').
Hope that helps, Chris.
That appears to have solved it. Thank you.
Might I suggest the following changes in the documentation for tableViewRow:
1) The wording for className be made much stronger. The implication is that there would be a performance hit. Not a fatal crash.
2) The text under notes use "className" not "tableClass".
Your Answer
Think you can help? Login to answer this question!