【发布时间】:2015-01-20 01:36:01
【问题描述】:
大家好,我正在尝试通过使用 XIB 文件在 ViewController 中显示自定义视图。
在我的自定义视图类中,我添加了这个,并通过情节提要 Contina 将类的名称和 View XIB CustomView 赋予了这个 ViewController,但我的应用程序崩溃了......
删除时应用程序不会崩溃
[[NSBundle mainBundle] loadNibNamed:@“NPUStepsView”所有者:self 选项:无];
我不明白我错在哪里......也许它不是 Xcode 6 中的正确方法?
-(id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if (self) {
[[NSBundle mainBundle] loadNibNamed:@"NPUStepsView" owner:self options:nil];
}
return self;
}
【问题讨论】:
标签: uiview uiviewcontroller ios8 xcode6 xib