I’m trying to change the text of a custom UITableViewCell based on whether the text says Closed or not. However, when the text is Closed, the color will not change. Here is a code snippet. http://pastie.org/1078690
Thanks.
I’m trying to change the text of a custom UITableViewCell based on whether the
Share
Simple equality does not work for NSString objects. Instead of
do
That will work – but I bet you could find a more efficient way of conditionally changing color than checking a string inside cellForRowAtIndexPath. Trouble is this method will be called often. You are reusing cells, which is an efficiency measure, that’s good. But then you do something relatively expensive like a string comparison – how about adding a BOOL that could be checked instead, and setting it when you decide on the cell’s text?