1

我没有NSURL在我的代码中使用任何 API,但 Xcode Instruments 说我的代码有很多__CFCachedURLResponse内存泄漏。

例如,

Leaked Object # Address Size Responsible Library Responsible Frame
__CFCachedURLResponse,10 < multiple > 320 Bytes IPhoneUIBase    
-[InterestGroupStockTR_RTS composeRTSData:]

代码是在创建添加几个对象到数组之后,然后调用自定义类。

NSMutableArray *arrCodes = [[NSMutableArray alloc] init];


for(int j = 0; j < countCode; j++ )
{
    NSDictionary *pData = [listData objectAtIndex:j];       
    NSString *stockCode = [ NSString stringWithFormat:@"%@", pData ];
            NSMutableDictionary *codeData2 = [[NSMutableDictionary alloc] initWithObjectsAndKeys:stockCode , @"acCode" , NULL ];
    [arrCodes addObject:codeData2];
    [codeData2 release];
}   
[trData.dict setObject:arrCodes forKey:@"MULTI_SBR_ARRAYRP"];               
[self requestWithData:trData];
    [arrCodes removeAllObjects];
[arrCodes release];
  • __CFCachedURLResponse另一个问题是和之间有什么区别__CFURLCacheNode__CFURLCacheNode根据仪器,某些类存在内存泄漏。

谢谢

4

0 回答 0