为什么我在启用 ARC 的情况下会出现内存泄漏(以粗体突出显示)?
我有 CustomCell.m
+(CustomCell*)cell
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
NSArray *nib =[[NSBundle mainBundle] loadNibNamed:@"CustomCell_iPhone" owner:self options:nil];
return [nib objectAtIndex:0];
} else {
NSArray *nib =[[NSBundle mainBundle] loadNibNamed:@"CustomCell_iPad" owner:self options:nil]; **//leaking 100%**
return [nib objectAtIndex:0];
}
}
在我的 tableview 控制器中:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
cell=[CustomCell cell]; **// 100% leaking**
...
}