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 11-06-2009, 10:32 AM   #3 (permalink)
krish
Registered Member
 
Join Date: Sep 2009
Posts: 9
Send a message via Yahoo to krish
Default Help

Quote:
Originally Posted by krille View Post
I fixed the problem myself. It is nothing wrong with the TouchXML Code - it was kind of stupid, but maybe someone might come across the same thing, so I am going to post it here.

1) I had a mutable array set up as instance variables like this:

Code:
    @interface XMLParser : NSObject {

    // ...  
    NSMutableArray *mobil;  
    // ...  
    }   
    @property(nonatomic, retain) NSMutableArray *mobil;  
    @end
Everytime I wanted to reset and store new data inside the array I did:
Code:
self.mobil = nil;
Which did not what I wanted to do, so this is the better approach:
Code:
[self.mobil removeAllObjects];
2) The dealloc method has to be like this to fix the leaks (because mobil is defined as a property):
Code:
    -(void)dealloc {  
      [mobil release];  
      self.mobil = nil;  
  }
Whew, that has been a lot of work to find out - hope it saves someone else some time :-)


Hi Friend,

I am going through a similar problem. I am also using a custom parser to parse incoming data. But when I check it through Leaks tool, I find the most of the objects I use are leaking. Pleas could you help me?.
krish is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Online Users: 225
12 members and 213 guests
Ajameel, andrei_c, chorew, Ed99, jazzbearz, Jupiterus, MartinIngvar, marwa, naqviak, pereorra, SiVola, ZunePod
Most users ever online was 779, 05-11-2009 at 09:55 AM.
» Stats
Members: 24,279
Threads: 39,072
Posts: 171,337
Top Poster: smasher (2,575)
Welcome to our newest member, yogen81
Powered by vBadvanced CMPS v3.1.0

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