문제

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?

도움이 되었습니까?

해결책

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

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top