Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 01-06-2009, 08: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 06:10 PM.
ichi is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Online Users: 339
15 members and 324 guests
AgCode, ansonl, beginer2007, bluelobster, ceggert, cordoprod, Eagle11, irishkiwi, Jeremy1026, kindelizaxi, mallmertl, mcgrath3, Rudy, slahteine, vargonian
Most users ever online was 779, 05-11-2009 at 09:55 AM.
» Stats
Members: 24,221
Threads: 39,001
Posts: 171,067
Top Poster: smasher (2,569)
Welcome to our newest member, kindelizaxi
Powered by vBadvanced CMPS v3.1.0

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