this class is not key value coding-compliant for the key view [duplicate]

If you have a control in your nib (xib file) that is linked to a property (IBOutlet) or method (IBAction) in your view controller, and you have either deleted or renamed the property or method, the runtime can’t find it because it has been renamed and therefore crashes.

In your case, you have set the Main Interface property of the project to your ViewController.nib. This is a problem because the only nibs that should be used as Main Interface should have UIWindows in them and the File Owner in that nib should be set to the AppDelegate. The UIWindow in the nib should be linked to the File Owner’s (AppDelegate) window property. Because you set that with a nib without the traits the runtime was looking for, it gives you this error.

The solution is to leave the Main Interface blank as you do not have to set up UIWindows manually anymore.

Leave a Comment