1. 對於 UITableViewCellAccessoryCheckmark,標記問題
解決方法:創建一個NsmultableArray 來記錄所選擇的indexpath.row
在創建cell時,判斷
if ([_checkArray containsObject:[NSNumber numberWithInt:indexPath.row]]) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
}else{
cell.accessoryType = UITableViewCellAccessoryNone;
}
if else一定要寫全
和創建
if (indexPath.row %2 == 0) {
cell.backgroundColor = [UIColor greenColor];
}else{
cell.backgroundColor = [UIColor clearColor];
}
else不可缺少
http://www.cocoachina.com/ask/questions/show/1916
http://blog.csdn.net/yesjava/article/details/8075720