当我在故事板中命名我的课程时,黑屏 [英] Black Screen when i name my classes in Story Boards
问题描述
我正在使用故事板并在特定视图控制器的Custom Class面板中,如果我给出包含该视图控制器代码的类的名称,我会得到一个空白屏幕。可能是什么问题呢?我尝试了一切。
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.
所以基本上Class通常是CustomClass中的UIViewController。我将其更改为MenuScreenViewController(一个ViewController目标C类,其中包含与此相关的代码)并且我以模态方式调用它。为什么我会出现空白屏幕。请紧急帮助。
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.
推荐答案
我的猜测,再一次:
删除执行来自UIViewController子类的 - (void)loadView
。在代码中创建viewControllers视图时,只需要此方法。从nib文件或故事板创建视图时,您不能使用此方法。
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.
但这不是你的错,由于Xcode 4.3 viewController模板中的一个错误,实现就在那里。
But it's not your fault, the implementation is there because of a bug in the Xcode 4.3 viewController templates.
编辑:此错误在Xcode 4.3.2中得到修复。模板不再包含 - (void)loadView
This bug is fixed in Xcode 4.3.2. The template does no longer contain - (void)loadView
这篇关于当我在故事板中命名我的课程时,黑屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!