Black Screen when i name my classes in Story Boards

隐身守侯 提交于 2019-12-23 00:48:14

问题


Im using story boards and in the Custom Class panel of the specific view controller if i give the name of the class that contains code for that view controller i get a blank screen. What could be the problem? Ive tried everything.

SO basically Class is usually UIViewController in CustomClass. I changed it to MenuScreenViewController(a ViewController objective C class that has code associated with this) and im calling it modally. Why do i get a blank screen. Urgent help please.


回答1:


My guess, once again:

remove the implementation of - (void)loadView from your UIViewController subclass. You only need this method when you create your viewControllers view in code. When you create the view from a nib file or storyboard you must not have this method.

But it's not your fault, the implementation is there because of a bug in the Xcode 4.3 viewController templates.

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



来源:https://stackoverflow.com/questions/9669995/black-screen-when-i-name-my-classes-in-story-boards

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!