iOS 常见错误
2015-12-10 17:44
393 查看
真心感觉iOS定位错误很难定位,这里记录一下常见错误对应的解决办法。当然同样的错误可能导致的错误原因有很多,下面给出的解决办法可能不完全能解决问题
解决办法: 鼠标选中File's Owner , 然后点击最右面连接面板的 show the Connections inspector,找到 Referencing Outlets ,如果每项后面有感叹号标记,那么将带有感叹号的全部删掉。 然后重新允许试试看 , good luck!
![](https://oscdn.geek-share.com/Uploads/Images/Content/202009/27/039f5a6356cf370eac3e21bdb00f5678)
![](http://blog.csdn.net/vbirdbest/article/details/file:/d:/program files/360se6/User Data/temp/DHo5r.png)
另外 File's Owner 不要设置Custom Class, 而自定义的Cell需要设置 Custom Class ---> Class xxxTableViewCell
3.-[__NSCFDictionary setObject:forKey:]: mutating method sent to immutable object' 解决方法:
1. this class is not key value coding-compliant for the key xxx.
问题背景: 我使用XIB自定UITableViewCell时,在给控件连线时(IBOutlet)完之后允许项目报错。解决办法: 鼠标选中File's Owner , 然后点击最右面连接面板的 show the Connections inspector,找到 Referencing Outlets ,如果每项后面有感叹号标记,那么将带有感叹号的全部删掉。 然后重新允许试试看 , good luck!
![](http://blog.csdn.net/vbirdbest/article/details/file:/d:/program files/360se6/User Data/temp/DHo5r.png)
另外 File's Owner 不要设置Custom Class, 而自定义的Cell需要设置 Custom Class ---> Class xxxTableViewCell
2. 代码块中引用self
__unsafe_unretained __typeof(self) this = self;3.-[__NSCFDictionary setObject:forKey:]: mutating method sent to immutable object' 解决方法:
NSMutableDictionary*d =[[[NSUserDefaults standardUserDefaults] objectForKey:@"xxxx"] mutableCopy];
不要使用这种方式,也不要使用(Xxx *)强转方式,使用下面这种方式获取 NSMutableDictionary
修改:NSMutableDictionary *user =[NSMutableDictionary dictionaryWithDictionary:[[NSUserDefaults standardUserDefaults] ForKey:@"xxxx"]];
相关文章推荐
- IOS手势识别
- iOS CoreAnimation专题——总览篇
- iOS 7 表视图顶部空白解决
- 04.iOS 使用lame将wav转换为mp3
- iOS重新定义系统自带的方法,如 重定义 CGRectMake 和 CGPointMake 可以解决屏幕适配的问题
- IOS中的触摸事件
- iOS 十进制 二进制 转换
- 需求 - 12 - 图片缓存
- ios 学习笔记之控件属性
- 模型的应用 && Xib &&代理模式的应用【应用管理】
- ios 实现图片上传的2种方式
- 【iOS 开发】如何去除tableView多余的空Cell
- Teemo__Tip1__iOS界面跳转及刷新
- iOS多线程编程之Grand Central Dispatch(GCD)介绍和使用
- iOS多线程编程之NSThread的使用
- iOS 学习日志 :利用AFNetWorking 做文件上传
- mask遮障效果实现注水动画
- iOS LocationManager定位国内偏移,火星坐标(GCJ-02)解决方法:接口转换法,代码转换法
- ios 学习总结之动画(转)
- iOS 学习日志:调用相机拍照获得图片旋转问题