开发者

NSCFString Memory Leak

I have been solving a lot of memory leaks but have been unsuccessful in solving this on开发者_StackOverflow中文版e. There are tons of NSCF memory leaks coming due to [NSCFString substringWithRange:]. I have been checking all the String allocations and have released all of them at appropriate places. The responsible library: Foundation.

Has anyone encountered this problem before? Can anyone suggest me as how I should takle this issue?

Thanks,

Lakshmie


General Block-3584 just means a malloc of 3584 bytes. It is not itself a component of any framework. Regardless, judging from info on the web, it appears to be a CFNetwork issue and its not entirely clear that it's a leak -- just that the Leaks tool thinks its a leak. In any case, this one probably isn't your fault and you can ignore it. - Matt


using the class methods of NSString, such as [NSString stringWithString:@"hi"] will leak, since memory was never allocated - you dont see an alloc in there, ya?. the proper way is:

NSString *temp = [[NSString alloc] initWithString:@"hi"];
myIvarProperty = temp;
[temp release];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜