上午下面的代码并且使用ARC即使在ARC中,物体的潜在泄漏?使用
NSString *text;
static NSString *[email protected]"Cell";
FeedsCell *cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[FeedsCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
if (indexPath.row == [feedsData count]-1)
{
[spinner startAnimating];
[spinner setHidesWhenStopped:YES];
OnDemand_fetch *getData = [[OnDemand_fetch alloc] init];
if(nextUrl != NULL)
{
NSString *nextfbUrl = [getData getnextFbfeedUrl];
NSString *nexturlEdited = [nextfbUrl stringByReplacingOccurrencesOfString:@"|" withString:@"%7C"];
[demandfetch getFeedsInBackground:nexturlEdited];
}
else
{
[spinner stopAnimating];
self.myTableView.tableFooterView=nil;
}
在分析,显示警告: “分配上线267和存储到‘的getData’的物体的潜在的泄漏”。
任何人都可以提出避免这种方法吗?这会造成什么麻烦?
感谢
你确定它是ARC吗?这对我来说看起来很好。 'getData'在其他地方使用吗? – WDUK
ya..am当然,我不使用其他地方的getData对象。 –
更改OnDemand_fetch * getData = [[OnDemand_fetch alloc] init];'OnDemand_fetch * getData = [[[OnDemand_fetch alloc] init] autorelease];'。这是否会在建造时造成任何错误? – WDUK