최근에 "Programming Without XIB 's"로 전환하고 Custom TableView 셀에 문제가 있습니다. XIB를 사용하는 경우 이전에, 내가 제발 말해 내가프로그래밍 방식의 사용자 지정 셀 메모리 누수 문제
static NSString *CellIdentifier = @"Cell";
ConditionReportCustomCell *cell = (ConditionReportCustomCell*)[self.inventoryTableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(cell==nil){
cell = [[ConditionReportCustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] ;
}
return cell;
을 뭐하는 거지 완벽하게 작동하는 다음 코드
NSString *CellIdentifier = @"Cell";
AttachmentCustomCell *cell=(AttachmentCustomCell*)[self.attachmenttableview dequeueReusableCellWithIdentifier:CellIdentifier];
if(cell==nil){
NSArray* objects= [[NSBundle mainBundle] loadNibNamed:@"AttachmentCustomCell" owner:nil options:nil];
AttachmentCustomCell *acell = [objects objectAtIndex:0];
cell = acell;
}
하지만 지금은 나에게 메모리 누수를 제공합니다 다음을 사용하고를 사용 잘못된. 나는 응용 프로그램의 충돌 결과로 autorelease를 사용하지 못할 것을 압니다.
cell = [[[ConditionReportCustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease] ;
프로에서 ARC를 사용 : –
죄송합니다, 언급하는 것을 잊었습니다. ARC를 사용하지 않고 있습니다. – Shantanu