In OUIViewController there is an OBPRECONDITION that requires unretained_prospective_parent to not be nil (see below). However, this will be nil in some cases. For example, using an OUIScalingViewController subclass in a view controller embedded in a nav controller via storyboard. In this case, willMoveToParentViewController is never called, which is where _unretained_prospective_parent is initially being set.
- (void)didMoveToParentViewController:(UIViewController *)parent;
{
DEBUG_PARENT_VC(@"In %s with parent: %@", __func__, parent);
OBPRECONDITION(parent == _unretained_prospective_parent);
...
_unretained_parent = parent;
}
In
OUIViewControllerthere is an OBPRECONDITION that requiresunretained_prospective_parentto not be nil (see below). However, this will be nil in some cases. For example, using anOUIScalingViewControllersubclass in a view controller embedded in a nav controller via storyboard. In this case,willMoveToParentViewControlleris never called, which is where_unretained_prospective_parentis initially being set.