The following is in my AppDelegate:
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
customViewController = [[CustomViewController alloc] initWithNibName:@"CustomViewController" bundle:nil];
self.navigationController = [[UINavigationController alloc] initWithRootViewController:customViewController];
[self.navigationController setNavigationBarHidden:YES];
self.window.rootViewController = self.navigationController;
[self.window makeKeyAndVisible];
In the actual XIB, the View is associated with the "File's Owner" and that is my only association there..
XIB Hierarchy:
Navigation Controller
- View Controller - Root View Controller
-View (Associated with File's Owner)
Sorry if I don't understand this, it was working fine on a previously launched app but I understand that does not mean it was correct.
Edit: Sorry here is the error I am getting:
* Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'A view can only be associated with at most one view controller at a time! View < UIView: 0xa192d00; frame = (0 20; 320 460); autoresize = W+H; layer = < CALayer: 0xa192d60>> is associated with < UIViewController: 0xa195c70>. Clear this association before associating this view with < CustomViewController: 0xa1802a0>.'
Make sure your views' interface does not have an extra view controller in its hierarchy. See the screenshots below
Before:
After:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With