안녕하세요. iOS (유니버설) 응용 프로그램을 만들고 있습니다. 제 문제는 응용 프로그램이 백그라운드로 이동하지 않으면 홈 버튼을 누르거나 URL 링크를 클릭하여 UITableView가 제대로 작동한다는 것입니다.응용 프로그램이 백그라운드에서 활성 상태가되고 UItableView가 다시로드되면 프로그램이 충돌합니다.
응용 프로그램이 백그라운드로 들어가면 활성화 될 때 셀을 다시로드하거나 전체 테이블보기가 전체 응용 프로그램을 중단시킵니다.
모든 솔루션 ???
dequeueReusableCellWithIdentifier를 제거하는 중 : 약간의 차이가 있습니까?
코드는 다음과 같습니다
- (UITableViewCell *)tableView:(UITableView *)tableView1 cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *identifier = @"Cell";
UITableViewCell *cell = [tableView1 dequeueReusableCellWithIdentifier:identifier];
if(cell == nil){
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
}
Animation *animation = [animationArray objectAtIndex:indexPath.row];
cell.textLabel.text = animation.title;
if(animation.isAnimationEnabled){
cell.imageView.image = OnImage;
}else {
cell.imageView.image = OffImage;
}
return cell;
}
자세한 정보를 제공해 주시겠습니까? 어떤 종류의 충돌, 일부 코드, 문장이 충돌하고 있습니까? –
코드를 보지 않고는 아무 말도 할 수 없습니다. 배경/전경을 입력 할 때 무엇을합니까? 'tableViewDataSource' 메소드는 어떻게 생겼습니까? 'dequeueReusableCellWithIdentifier :'는 이유 (셀 재사용)가 있지만 올바르게 사용되어야합니다. –
viewDidUnload에서 중요한 것을 할당 해제했는지 확인하십시오. – nhahtdh