I am adding a ViewControllers view as a subView to another ViewController,
Example :
In FirstScreen viewcontroller i do this,
[self.view addSubview:self.secondScreen.view];
And Once i remove it from FirstScreen i do this
[self.secondScreen.view removeFromSuperView];
self.secondScreen=nil;
But While Adding the subView ViewDidLoad method is called but while removeFromSuperView ViewDidUnLoad is not called.
My Question
1) will all my objects in my secondScreen will get deallocated once i set the instance self.secondScreen to nil
2)Is it safe to do like this so that i wont get any leaks or memory warning