(Xcode 5,ios7,arc)i have a view controller,it have a tableview,The problem is that cell loading picture, make a memory leak. I have repeatedly push the view controller ,and then back, memory continues to increase. My English is not good, do not know whether the clear expression.
How to solve the problem of excessive picture memory, hope to master for help.
Here is the code:
@implementation SearchCell
-(void)dealloc
{
_imageV = nil;
_titleL = nil;
_infoL = nil;
_countL = nil;
}
+(instancetype) cellWithTableView:(UITableView *)tableView model:(SearchModel *)model
{
static NSString* strID = @"SPECIALCELL";
SearchCell* cell = [tableView dequeueReusableCellWithIdentifier:strID];
if (cell == nil) {
cell = [[[NSBundle mainBundle] loadNibNamed:@"SearchCell" owner:nil options:nil] lastObject];
}
[cell setSearchCellModel:model];
return cell;
}
-(void) setSearchCellModel:(SearchModel*)model
{
UIImage* img = [[SDWebImageManager sharedManager] imageWithURL:[NSURL URLWithString:model.tvImgURL]];
self.imageV.image = img;
self.titleL.text = model.tvName;
self.infoL.text = model.tvInfo;
self.countL.text = model.tvCount;
}