I have two uiviewcontroller and i am releasing all the resources in dealloc and setting them to nil in didunload but still when i came across to both viewcontrollers the memory keep on increasing.
I am keeping the track of memory used and free memory from this post
Can anyone suggest why this is happening?
this is the second viewcontroller:
- (void)viewDidUnload {
adView.delegate = nil;
[self setCountDown:nil];
[self setUploadPhoto:nil];
[self setBackclicked:nil];
[self setInfo:nil];
[self setCloseButton:nil];
[self setHow2usebg:nil];
[self setHow2useInstruction:nil];
[self setHow2useicon:nil];
[self setVc1:nil];
[self setVc:nil];
adView = nil;
[super viewDidUnload];
}
-(void)dealloc
{
[adView release];
[closeButton release];
[how2usebg release];
[how2useInstruction release];
[how2useicon release];
[videoRecorder1 release];
[uploadPhoto release];
[countDown release];
[backclicked release];
[info release];
[vc release];
[talkingImage release];
[backgroundImage release];
[super dealloc];
}
I think u are adding a viewcontroller upon another viewcontroller.. like the below line..
[self.view addSubView:yoursecondview];
Create a Appdelegate object and then add the window, instead of self.view
AppDelegate *object=[[UIApplication SharedApplication] delegate];
[self.view removeFromSuperview];
[object.window addSubView:yoursecondview];