UIViewController _loadViewFromNibNamed:bundle:] loaded the "loc" nib but the view outlet was not set
来源:互联网 发布:智能数据分析系统 编辑:程序博客网 时间:2024/05/16 02:26
当应用 initWithNibName 函数, 并应用 由nib文件生成的ViewController 的view属性时辰,碰到这个题目。
//load loc.xib
UIViewController * UIVC = [[UIViewController alloc] initWithNibName:@"loc" bundle:nil];
[self.view addSubview:UIVC.view];
[UIVC release];
NibName[2203:207] *** Terminating app due to uncaught exception ""NSInternalInconsistencyException"", reason: ""-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "loc" nib but the view outlet was not set.""
概况意思是指 我们加载的nib文件,"view" 属性值没有进行设置.
这里的实际景象: 不是所生成的 VC 的view属性值为 nil, 而是所生成的 VC 没有 view 这个属性。 我们应用的是UIViewController 定义的VC, 为什么 VC (View Controller) 会没有 view 属性呢?
(多么具有逻辑性的表述都不如一次成功的完全操纵,begin :)
解决规划:
1. 点击我们要加载的 xib 文件
2. 在右边选中 File""s Owner
3. 在 File""s Owner 的 选项卡的“Custom Class” 属性设置中,将 Class 的值改成对应的 VC, 这里改成 UIViewController,
4. 这时辰,在File""s Owner 的 选项卡中, 就 会呈现“待连接设置” 的 view 属性, 也即我们的编译器 告诉我们的 the view outlet was not set 中的 view。当 File""s Owner 的 class 为 NSObject 时辰,是没有 view 属性的。
连接 view 属性,
5. win+r, OK.
- UIViewController _loadViewFromNibNamed:bundle:] loaded the "loc" nib but the view outlet was not set
- UIViewController _loadViewFromNibNamed:bundle:] loaded the "loc" nib but the view outlet was not set
- UIViewController _loadViewFromNibNamed:bundle:] loaded the "loc" nib but the view outlet was not set
- [UIViewController _loadViewFromNibNamed:bundle:] loaded the nib but the view outlet was not set
- [UIViewController _loadViewFromNibNamed:bundle:] loaded the "One" nib but the view outlet was not se
- -[UIViewController _loadViewFromNibNamed:bundle:] loaded the "xxx" nib but the view outlet was not s
- [UIViewController _loadViewFromNibNamed:bundle:] loaded the "XXX.xib" nib but the view outlet was no
- loaded the "***" nib but the view outlet was not set
- loaded the nib but the view outlet was not set
- loaded some nib but the view outlet was not set
- loaded the nib but view outlet was not set
- loaded some nib but the view outlet was not set
- loaded nib but the view outlet was not set
- -[UIViewController _loadViewFromNibNamed:bundle:] loaded the "RecommendViewController" nib but the v
- loaded the "ViewControll" nib but theview outlet was not set
- iPhone 自检工程错误解决方法:loaded the "MyView" nib but the view outlet was not set
- loaded the "BlueView" nib but the view outlet was not set 错误的解决办法。
- loaded the "MyView" nib but the view outlet was not set错误
- IOS plist文件的增删操作
- ArcPad 10 的安装部署
- 2013年1季度中国自主A0级车品牌口碑研究报告
- eclipse 修改设置Ctrl+Shift+F长度
- 数组,transferFrom,ByteBuffer数据传输对比
- UIViewController _loadViewFromNibNamed:bundle:] loaded the "loc" nib but the view outlet was not set
- CentOS6.2安装配置tomcat
- 录音 - 静音检测(转)
- Hibernate进行单向Many-to-Many映射时如果只删除一方及中间表,切忌莫加入Cascade
- 程序中提醒用户进去App Store 评分 跳转 代码
- sqlserver,oracle,mysql等的driver驱动,url怎么写
- android 读取doc文档
- UVa:490 - Rotating Sentences
- 如何测试CTS4.1