Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sujithkrishnan

macrumors 6502
Original poster
May 9, 2008
265
0
Bangalore
Hi all..


My app is crashing after i navigate between the viewcontrollers so many times...

Also the ApplicationRecievedMemoryWarning getting called...

I have four/five view controllers (dynamically decided)...

as all the viewcontrollers are similar kind i am creating an instance of the same kind and pushing it...

Say in my firstViewController.m

i am pushing "anotherInstanceOfFirstViewController" , but the array used to generate the tableViewCells will vary with sub-levels.

ie..

in firstViewController..
on clicking any cell in tableview


anotherInstanceOfFirstViewController = [[firstViewController alloc]init];
self.menuObj = [self.arrayOfNameForCells objectAtIndex:someNumber];
anotherInstanceOfFirstViewController.arrayOfNameForCells = self.menuObj.arrayOfNames;
push self.anotherInstanceOfFirstViewController



I am releasing the anotherInstanceOfFirstViewController in dealloc (But the retainCount is not zero in dealloc )...

Moreover the app crashing after some forward/backward navigation ....

So in the ne
 

SwampThingTom

macrumors member
Jul 12, 2008
37
0
Fairfax, VA
You almost certainly have a memory leak. Use the Instrumentation application to find it. It makes it trivial to find exactly the line of code where the leak occurs so you can find out why it's not being released.

Tom
 

sujithkrishnan

macrumors 6502
Original poster
May 9, 2008
265
0
Bangalore
You almost certainly have a memory leak. Use the Instrumentation application to find it. It makes it trivial to find exactly the line of code where the leak occurs so you can find out why it's not being released.

Tom

But the leak is showing in lines like where i am unarchiving....

also..

NSData *data = [[NSData alloc]initWithURL:myURL];

Noty getting what is leaking here....

I am releasing data soon after using it to make an UIImage ...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.