加载自定义视图时出现 NSInternalInconsistencyException [关闭]
Posted
技术标签:
【中文标题】加载自定义视图时出现 NSInternalInconsistencyException [关闭]【英文标题】:NSInternalInconsistencyException while loading custom view [closed] 【发布时间】:2011-12-01 05:17:40 【问题描述】:2011-12-01 10:30:37.211 basicViewBased[496:207] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "chapterViewController" nib but the view outlet was not set.'
2011-12-01 10:30:37.213 basicViewBased[496:207] Stack: (
42182736,
43340588,
41920267,
41920106,
3534983,
3526704,
3526410,
11676,
3526533,
3519391,
3579886,
3575616,
3583801,
3559329,
3586719,
3558971,
11384,
2903278,
3400766,
3410112,
3404909,
3030504,
2922051,
2953688,
51175804,
41461916,
41457832,
51169437,
51169634,
2945906,
9732,
9586
)
terminate called after throwing an instance of 'NSException'
【问题讨论】:
你应该参考 [Loaded nib but the view outlet was not set - new to InterfaceBuilder][1] 和 ['NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] 加载了 GameView nib但未设置视图出口][2] 帖子。 [1]:***.com/questions/4763519/… [2]:***.com/questions/5464010/… 【参考方案1】:在 xib 文件中,您没有将视图与 xib 连接。
【讨论】:
我们也这样做了,但仍然显示异常 清除所有目标并重新运行 也这样做了。我正在一个 xib 上加载两个自定义视图。以上是关于加载自定义视图时出现 NSInternalInconsistencyException [关闭]的主要内容,如果未能解决你的问题,请参考以下文章
在 DialogFragment 中为 AlertDialog 膨胀自定义视图时出现问题