朋友们,
我在仪器中运行我的代码,它在 5 行中显示内存泄漏(超出以下代码),即 cell = [[[NSBundle mainBundle] loadNibNamed:@"ZoomCustomVideoCell" owner:self options:nil] objectAtIndex:0];
我不知道为什么它在那里显示内存泄漏以及相同的解决方案是什么
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"ZoomCustomVideoCell";
ZoomCustomVideoCell *cell = (ZoomCustomVideoCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[NSBundle mainBundle] loadNibNamed:@"ZoomCustomVideoCell" owner:self options:nil] objectAtIndex:0];
cell.m_zoomMsg = [[[ZoomMessage alloc] init] autorelease];
[[cell m_zoomMsg] initWithJSON:[m_tmpVideoList objectAtIndex: indexPath.row]];
[[cell videoLabel] setText:[cell.m_zoomMsg _from]];
[[cell m_labelLocation] setText:[NSString stringWithFormat:@"%@", cell.m_zoomMsg._location]];
[[cell videoLabelB] setText:[cell.m_zoomMsg _uploadDesc]];
NSLog(@"UserName: %@", [[cell videoLabel] text]);
[cell refreshImage];
}
return cell;
}