I am having memory leaks when I m using a view controller's view My code sequence is like this
viewController1 = [[ViewController alloc] init];
destinationViewController = [[DestinationViewController alloc] init];
[destinationViewCOntroller useView:viewController1.view];
[viewController1 release];
[destinationViewController release];
And for testing purpose I have empty implementation in useView method. So my problem is viewController1 is never getting deallocated. I have made sure that no other place has any reference to viewController1. When I remove the method call(useView) where I pass viewcontroller1.view then viewcontroller1 is deallocating properly. Any ideas why the behaviour is like this?