上午下面的代碼並且使用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