I have a view-based application and I’d like to make a change to which UIView is displayed via my UIViewController. I set up an IBOutlet UIViewController *viewController and then linked it in Interface Builder, however whenever I make this link the app crashes right on startup with SIGKILL. Has anyone ever had any experience with this and is there any alternate way to go about what I’m trying to do?
Thanks in advance!
you’re doing it the wrong way around. The nib contains the
UIViewController, which is synthesized on nib load. The nib also contains theUIView, which is linked to theviewproperty of theUIViewController.Just add another
UIView(or derived class thereof) to the nib and link it to theUIViewController‘sviewproperty.In your view controller, you can access this view through the view property.