I usually use lazy instatiation in those cases:
Declare a property for your ViewController:
@property(nonatomic, strong) UIViewController *myViewController;
After that you can override the get of myViewController
-(UIViewController*) myViewController {
if(!_myViewController) {
_myViewController = [[UIViewController alloc] init];
}
return _myViewController;
}
This way you guarantee that was only instantiated once and is always there when you needed.
ATTENTION
This works well if you always use self.myViewController
. I consider a good practice that properties' generated iVars should only be accessed in their setters/getters.