uitableview 셀은 셀을 재사용하지만 셀을 재사용하고 싶지 않습니다. tableView에서 셀의 텍스트가 삭제됩니다. 그래서 didloadview에 모든 셀을 만들고 싶습니다. 이 코드를 작성하는 방법 ?? !!dequeueReusableCell을 비활성화하여 모든 tableviewCell보기를로드하는 방법은 무엇입니까?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
//test
setting_detail_cell *customCell = (setting_detail_cell*)[tableView cellForRowAtIndexPath:indexPath];***
NSString *keyword1 = [[customCell Key1] text];
//
setting_cell=[tableView dequeueReusableCellWithIdentifier:CellTableIdentifier];
rowData = self.PPT_Setting[indexPath.row];
[setting_cell setNumber:rowData[@"page_num"]];
@try {
rowData_keyword =self.Keyword_list[indexPath.row];
setting_cell.Key1.text = rowData_keyword[@"key1"];
setting_cell.Key2.text = rowData_keyword[@"key2"];
setting_cell.Key3.text = rowData_keyword[@"key3"];
NSLog(@"index1 : %d",indexPath.row);;
NSLog(@"cell : %@",setting_cell);
if ([rowData_keyword[@"key1"] isEqualToString:@"(null)"] == YES) {
setting_cell.Key1.text = @" ";
}
if ([rowData_keyword[@"key2"] isEqualToString:@"(null)"] == YES) {
setting_cell.Key2.text = @" ";
}
if ([rowData_keyword[@"key3"] isEqualToString:@"(null)"] == YES) {
setting_cell.Key3.text = @" ";
}
}@catch (NSException *exception) {
NSLog(@"%@",exception);
}
return setting_cell;
}
'dequeueReusableCellWithIdentifier' 코드를 제거하고 항상 init 셀을 할당하십시오. –
그게 무슨 뜻이야?! 세포를 재사용 할 때 원하는 모든 것을 할 수 있습니다. – Injectios
dequeue-method를 사용하지 말고 대신 수동으로 셀을 초기화하십시오. 그러나 나는 정말로 당신이 그것을하고 싶지 않다는 것을 확신합니다! 당신이 이것을 원한다는 이유를 설명 할 수 있다면, 우리는 아마도 당신이 실제로 가지고있는 문제에 대한 해결책을 줄 수 있습니다. – Moonwalkr