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 01-06-2009, 09:00 AM   #9 (permalink)
ichi
New Member
 
Join Date: Aug 2008
Posts: 22
Default

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...

Last edited by ichi; 01-16-2009 at 07:10 PM.
ichi is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,672
Threads: 89,155
Posts: 380,385
Top Poster: BrianSlick (7,110)
Welcome to our newest member, JMadisonT2012
Powered by vBadvanced CMPS v3.1.0

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