D_D*_*D_D 1 iphone ipad ios ios5
我正在使用以下代码并且正在使用 ARC
NSString *text;
static NSString *CellIdentifier=@"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;
}
Run Code Online (Sandbox Code Playgroud)
在分析时,显示警告:“在第 267 行分配并存储到‘getData’中的对象可能存在泄漏。”
任何人都可以建议避免这种情况的方法吗?这会造成什么麻烦吗?
谢谢
没有错误!但我正在使用 ARC!为什么会有这种奇怪的行为?
因为......你没有使用ARC。不知道为什么你认为你是。要转换为 ARC,请转到 Edit->Refactor->Convert to Objective-C ARC。

如果您不想全力以赴,并且 ARC 一切,您可以将-fobjc-arc作为编译器标志添加到要使用 ARC 的文件中,项目是非 ARC。