특히 Checkmark, 특히 TableView 셀이 필요합니다.UITableView 셀의 체크 표시
그래서 내가 사용한 코드 :
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
newRow = [indexPath row];
oldRow = [lastIndexPath row];
if (newRow != oldRow) {
UITableViewCell *newCell = [tableView cellForRowAtIndexPath:indexPath];
newCell.accessoryType = UITableViewCellAccessoryCheckmark;
UITableViewCell *oldCell = [tableView cellForRowAtIndexPath: lastIndexPath];
oldCell.accessoryType = UITableViewCellAccessoryNone;
lastIndexPath = indexPath;
}
else{
UITableViewCell *newCell = [tableView cellForRowAtIndexPath:indexPath];
newCell.accessoryType = UITableViewCellAccessoryCheckmark;
lastIndexPath = indexPath;
}}
아이폰 시뮬레이터 벌금에서 작업. 그러나 iPhone 장치에서 테스트하는 동안 응용 프로그램이 충돌합니다.
이 문제에 대한 해결책은 무엇입니까?
미리 감사드립니다.
충돌 오류 메시지 란 무엇입니까? – lnafziger
EXE_BAD_ACCESS for oldRow = [lastIndexPath row]; –