Below is the code in which i have some doubts:-
MyController *vc= [MyViewController alloc] initWithNibName:@"myController"
bundle:nil];
[self.navigationController pushViewController:vc animated:YES];
[vc release];
Then, i pop my controller by pressing the back button on nav bar.
The problem is memory is increased by 5mb(On Activity Monitor) for the first time.And when i pop the controller it doesnt get released. And when i do the push and pop again and again the memory increases by small amount and decreased too.
UIView *myView=[UIView alloc]init];
self.vi=myView;
[myView release];
UIScrollView *mySv=[UIScrollView alloc]init];
self.sv=mySv;
[mySvrelease];
UIProgressView*myPv=[UIProgressViewalloc]init];
self.pv=myPv;
[myPvrelease];
UIWebView *myWv=[UIWebView alloc]init];
self.wv=myWv;
[myWv release];
-(void)dealloc { [wv relase];
[sv release]
[pv release];
[vi release];
[super dealloc];
}
wv,sv,pv,vi are MyViewControoler variables which have retain attribute. I wrote this code to check the memory management concepts,but iam confused now seeing the activity monitor and instruments results.
I have verified that no object is getting leaked in my MyController class by using Instruments on it.