Why are the contents of my UITableViewCell disappearing?
Posted
by barfoon
on Stack Overflow
See other posts from Stack Overflow
or by barfoon
Published on 2010-03-18T14:17:36Z
Indexed on
2010/03/18
15:41 UTC
Read the original article
Hit count: 310
Hey everyone,
I am learning about using the checkmark cell accessory and am wondering why the contents of my cell is disappearing when toggling it.
Here is my code:
+ (void) toggleCheckmarkedCell:(UITableViewCell *)cell {
if (cell.accessoryType == UITableViewCellAccessoryNone)
cell.accessoryType = UITableViewCellAccessoryCheckmark;
else
cell.accessoryType = UITableViewCellAccessoryNone;
}
And here is didSelectRowAtIndexPath:
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
[RootViewController toggleCheckmarkedCell:cell];
The checkmark is toggling on/off and is visible but the main contents of the cell disappears. Can anyone explain why this is happening?
Thank you,
© Stack Overflow or respective owner