开发者

NSMutableArray leaks

开发者 https://www.devze.com 2023-02-19 17:31 出处:网络
I am trying the create a NSMutableArray by reading the contents of a file. NSString *filePath = FILE_PATH;

I am trying the create a NSMutableArray by reading the contents of a file.

NSString *filePath = FILE_PATH;

NSMutableArray *tempArr = [[NSMutableArray alloc] initWithContentsOfFile:filePath];

    ...

   [tempArr release];

But i am getting memory leaks in the line where i am alloca开发者_高级运维ting the array.

What is the bug in the code ?

Thanks


As Vladimir said the problem is between those lines. Leaks showing the leak where the variable was created. But in fact you're over-retaining that array somewhere. double check your code.

0

精彩评论

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

关注公众号