当前位置: 动力学知识库 > 问答 > 编程问答 >

ios - potential leak of an object stored into cell

问题描述:

Please don't make it as duplicate as there are many question and answer which refer to my question. But I am not able to found my error from their answer.

My project is under ARC. I have implemented the below method

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

{

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:UITableViewCountryPickerCellIdentifier];

if(!cell) cell=[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:UITableViewCountryPickerCellIdentifier];

[[cell textLabel] setFont:[UIFont fontWithName:BDS_FONT size:BDS_FONT_SIZE_TITLE_16]];

[[cell textLabel] setTextColor:[UIColor lightBlackColor]];

[[cell textLabel] setText:(NSString *)[countryArray objectAtIndex:[indexPath row]]];

[cell setSelectionStyle:UITableViewCellSelectionStyleNone];

return cell;

}

Where on return cell Xcode anlyzer shows potential leak of an object stored into cell and on expanding it show something like below

I can't understand what to do. Can anybody help me what's happening.

This code is under CountryPickerViewController.m and ARC is enable for this file.

分享给朋友:
您可能感兴趣的文章:
随机阅读: