【iOS】iOS/Xcode异常:reason:loaded the “SimpleTableViewController” nib but the view outlet was not set

具体异常信息:

SimpleTable3[29418:11303] *** Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘-[UIViewController _loadViewFromNibNamed:bundle:] loaded the “SimpleTableViewController” nib but the view outlet was not set.’
libc++abi.dylib: terminate called throwing an exception

分析原因:

view的outlet输出口没有设置,也就是view视图没有和ViewController 视图控制器(或File’s Owner)建立连接。

如下图所示,这个连接关系在创建项目过程或者nib文件时,是默认建立这个连接关系的,只是有可能在开发过程中,不小心误操作,删除了这个连接关系。

如果上述view视图到视图控制器(File’s Owner)的输出口连接不存在了,可以按照下图重新建立到输出口outlet的连接,如图所示。

选择视图,在右侧的Connections Inspector 面板窗口,拖拉New Referencing Outlet右侧的图标到File’s Owner图标上,在弹出的上下文菜单中,选择view,就可以创建view视图对象到视图控制器的输出口outlet连接了。

其他参考链接:

iOS/Xcode异常:reason: -[NSDecimalNumber isEqualToString:]: unrecognized selector sent to instance
iOS/Xcode异常:unrecognized selector sent to instance 0x7fae23417410
iOS/Xcode异常:reason: ‘Could not instantiate class named NSLayoutConstraint’
iOS/Xcode异常:reason = “The model used to open the store is incompatible with the one used to create the store”
iOS/Xcode异常:对象数组NSMutableArray添加元素-addObject,但count方法仍然返回0?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值