setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key
来源:互联网 发布:heroku自定义域名 编辑:程序博客网 时间:2024/05/18 02:08
今天在写自定义UITableViewCell的时候遇到一个Crash,特别无语,折腾了大半天,终于解决了。
Bug如下:
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<NSObject 0x8a4b500> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key strss.'
先说解决办法吧:
然后讲故事:
1.如何使用IOS UITableView?
参考:http://blog.csdn.net/h3c4lenovo/article/details/8307253
2.如何使用自定义的UITableViewCell实现UITableView?
参考:http://www.howzhi.com/group/iosDevelop/discuss/2068
3.单独创建的xib/nib文件如何与.h/.m文件关联起来?
定义xib中File's Owner 或 View的Custom Class 如上图所示。注:网上大部分说报错的原因要么就是存在无效的连接,或者File's Owner的custom class没有连接。
4.代码中如何引用自定义的TableViewCell?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *CustomCellIdentifier = @"testCellIdentifier"; static BOOL nibsRegistered = NO; if (!nibsRegistered) { UINib *nib = [UINib nibWithNibName:@"testCell" bundle:nil]; [tableView registerNib:nib forCellReuseIdentifier:CustomCellIdentifier]; nibsRegistered = YES; } testCell *cell = [tableView dequeueReusableCellWithIdentifier:CustomCellIdentifier]; [cell setMyText:@"xxx"]; return cell;}
- setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key
- setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key
- setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key
- setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key
- setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key
- ... setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key latitudeLab
- setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key name.
- setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key解决办法
- setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key lable1.'
- iOS: setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key name.
- iOS setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key 问题
- question:setValue:forUndefinedKey: this class is not key value coding-compliant for the key
- setValue:forUndefinedKey this class is not key value coding-compliant for the key
- setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key
- 关于 setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key的另一种错误
- iOS Xcode 6报错:setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key v
- iOS- 报错(崩)[< > setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key
- ViewController 0x8f35e00> setValue:forUndefinedKey:]: this class is not key value coding-compliant f
- 使用C#将Excel文件中数据导入SQL Server数据库
- 印度数据中心外包项目动态概述
- Android: 查找USB设备
- ORCALE数据库分页查询
- http的4种提交方式简要介绍(get,post,put,delete)
- setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key
- instancetype vs id
- Oracle 10g RAC架构
- dbx分析core文件
- How Data Center Services Market Differs in Geographic Regions: Gartner
- NET中Application,Session,Cookie,ViewState,Cache,Hidden 缓存机制
- android:与USB设备通信
- 故障诊断工具glassbox应用到Apusic+linux之上
- 理解程序内存