Domanda

I have my storyboard like in this picture: enter image description here

It works before I change in the right view the class from de default UIViewController to my MenuViewController. If I change it, when I push the button it turns black on emulator.

What I am doing wrong?

È stato utile?

Soluzione

Just a guess:

remove the - (void)loadView implementation from your code. You don't need that for view controllers that are created from a nib file (or a storyboard).

Most likely it is there because of a bug in the new Xcode templates.

EDIT: This bug is fixed in Xcode 4.3.2. The template does no longer contain - (void)loadView

Altri suggerimenti

This happened to me once and I couldn't figure out why. In the end I deleted the ViewController.h and .m and created new ones and it worked. Originally I may have created class files as UIView an tried changing them to UIViewController. Creating new ones as UIViewController worked.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top