views:

34

answers:

1

I try to load a plist file from my server. I can think of 2 ways to do that, but for both Instruments says there's huge memory leak :

NSData* plistData = [NSData dataWithContentsOfURL:url];

and

NSDictionary* updateDigest = [NSDictionary dictionaryWithContentsOfURL: [NSURL URLWithString:updateURL] ];

The backtrace of the memory leak leads to __CFURLCache in CFNetwork and I am wondering if something can be done to fix the leak? Any other way to load a remote plist xml, without the memory leakage ?

Thanks

+1  A: 

The leak probably isn't coming from loading the data. It's probably from retaining the data elsewhere and not releasing it.

Tom Dalling
Yes Tom indeed, put by mistake retain to a property which had to only assign. Thanks :)
Ican Zilb