Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 07-28-2009, 02:55 PM   #10 (permalink)
RomainL
New Member
 
Join Date: Jul 2009
Posts: 1
Unhappy

Quote:
Originally Posted by ichi View Post
I had this problem and it was doing my head in...

If I did this it like this (using NSData to load the file)
Code:
NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"index.xml"];
NSData *xml = [NSData dataWithContentsOfFile:path];
	
NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithData:xml];
Then it didn't leak, but if I did this (loading it from an URL)...
Code:
NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:url];
It leaked (small, but still annoying).
I found a post that said if you put this before you init the xmlParser, then it stops it leaking and it worked for me...
Code:
[[NSURLCache sharedURLCache] setMemoryCapacity:0];
[[NSURLCache sharedURLCache] setDiskCapacity:0];
I hope that helps someone else, as I've spent hours trying to figure that out...
Unfortunately, my NSXMLParser is leaking, even when putting those 2 lines of cache configuration. I was using initWithData anyway, and calling initWithContentsOfURL didn't change anything. Don't know what to do then...
RomainL is offline   Reply With Quote
 

» Advertisements
» Online Users: 553
17 members and 536 guests
BravadoWaffle, brianmethod, chrisedjohn, Dani77, flamingliquid, GameViewPoint, Gudus, hanna1gerd, HemiMG, JasonR, mer10, observer247, Oral B, poisenden, RickSDK, Touchmint, ziocleto
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,749
Threads: 89,202
Posts: 380,573
Top Poster: BrianSlick (7,129)
Welcome to our newest member, edinburgh1
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:28 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.