简体   繁体   中英

Error in segue two view controllers

I have my storyboard like in this picture: 在此处输入图片说明

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM