셀을 선택한 경우 셀의 textLabel 및 detailTextLabel을 변경하려고합니다. 나는 다음을 시도했지만, 변화는 발생하지 않는다 :UITableViewCell이 선택되었을 때 textLabel을 어떻게 변경합니까?
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
MyAppDelegate *appDelegate = (MyPhoneAppDelegate*)[[UIApplication sharedApplication] delegate];
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.detailTextLabel.text = @"xxxxx";
cell.textLabel.text = @"zzzzz";
[tableView reloadData];
}
전화 교체를 고려 새로운 빈 테이블보기를 인스턴스화하는 것입니다 사용자 정의 셀보기를 사용한다면 어떨까요? – meridimus
사용자 정의 셀보기는 UITableViewCell의 contentView로 설정된보기이므로 동일합니다. setNeedsDisplay는 contentView를 다시 그립니다. – yonel