I want to release UIViewController object in iOS 5. Prior iOS versions (>5.0) we write always code or maintaining code with memory free leaks following,
if(myViewControllerObject != nil){
[myViewControllerObject.view removeFromSuperView];
[myViewControllerObject release];
myViewControllerObject = nil;
}
myViewControllerObject = [[MyViewControllerObject alloc] initWithNibName:@"MyViewControllerObject" bundle:nil];
[self.view addSubview: myViewControllerObject.view];
But in iOS 5 we can not use release method for release UIviewController object then what we have to do in iOS 5 to maintaining extra object allocation and leaks? What will be the best method to implement this hierarchy?
Thanks.