UITableView에서 나중에 사용할 TableViewCell에 UIImage 콘센트가 있습니다. 악기에서 이것을 검사 할 때 UIImageView에서 메모리 누수가 발생합니다. UITableViewCell에서 UIImageView를 공개하지는 않습니다. 왜냐하면 tavleViewCell에서 release하면 exc_bad_access가 생기기 때문입니다.UITableViewCell에서 UIImageView를 해제하는 방법?
제 질문은 어디에서 UIImageView를 릴리스합니까?
업데이트
CustomCell.h는
@interface CustomCell : UITableViewCell {
IBOutlet UIImageView *customImage;
}
@property(nonatomic, retain) UIImageView *customImage;
@end
CustomViewController.m는
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"CustomCell";
CustomCell *cell = (CustomCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell.customImage.hidden = [[self.customImageList objectAtIndex:indexPath.row] boolValue];
return cell;
}
내가 아는 한, UITableViewCell 하위 클래스를 사용하고 있습니다. 인터페이스 정의를 포함하여 코드를 pst해야합니다. – vikingosegundo
셀의 dealloc에서 셀이 소유 한 개체를 해제해야합니다. 이 릴리스에서는 예외가 발생해서는 안됩니다. 예외가 발생하면 코드의 유지/릴리스 균형에 문제가 있습니다. – progrmr