*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[__NSCFDictionary setObject:forKey:]: mutating method sent to immutable object'

初始代码

NSMutableDictionary *dataDict=[[NSMutableDictionary alloc]init];

dataDict=responseObject[@"post"];

NSString *str=dataDict[@"content"];
str=[self handleStringWithString:str];               
[dataDict setObject:str forKey:@"content"];

这是由于我把不可变的字典赋到可变字典,只要修改为

dataDict=  [NSMutableDictionary dictionaryWithDictionary:responseObject[@"post"]];

就可以了。

在使用可变数组过程中遇到*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[__NSCFDictionary setObject:forKey:]: mutating method sent to immutable object'问题的更多相关文章

  1. Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]'

    报错: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlace ...

  2. iOS Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to

    刚接触iOS,依照教程操作执行出现错误 Terminating app due to uncaught exception 'NSInternalInconsistencyException', re ...

  3. Terminating app due to uncaught exception 'NSUnknownKeyException' this class is not key value coding-compliant for the key

     Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ViewController > se ...

  4. *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ViewController > setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key

    *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ViewController > ...

  5. *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '[<_UIFeedbackParameters 0x1d4442e50> setNilValueForKey]: could not set nil as the value for the key rate.'

    *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '[<_UIFeedbac ...

  6. iOS程序崩溃*** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [37.5 nan]'

    今天上班打开昨天的程序运行,昨天跑的很溜的程序今天竟然crash了,好郁闷啊!下面附上crash的栈打印信息: 经过一番调试终于找到了原因,程序crash是因为CALayer的位置中含有不存在的数,就 ...

  7. Terminating app due to uncaught exception 'NSUnknownKeyException', reason: xxxx

    出现错误的情景: 使用Swift自定义Cell, 然后将这个Cell在OC中使用, 由于为了能够在OC中使用和使用起来命名比较规范 我在Swift自定义的Cell前加了 @objc(DSProduct ...

  8. *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<WKWebViewConfiguration 0x1701bcd20> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the k

    问题描述: ionic项目,windows下正常,打包android可正常运行: 因为需要打包到iPhone (ios 11.0.1)上测试,将代码拿到Mac OS环境下(重新npm install. ...

  9. Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSInvocation setArgument:atIndex:]: index (3) out of bounds [-1, 2]'

    这是相机调用方法的时候参数错误

随机推荐

  1. project3 blockchain

    [概念] 做服务的时候main里面不能单独有东西,都得包起来. Identifier expected是因为没有main函数 雾草,task3还要加proxy, add再干别的.难受!妈的,什么代理模 ...

  2. @Autowired注解和静态方法

    @Autowired注解入static属性时,出现NullPointerException异常. 使用构造方法可解决: @Component public class Test { private s ...

  3. Requset模块

    Requests是用python语言基于urllib编写的,采用的是Apache2 Licensed开源协议的HTTP库 各种请求方式: #!/urs/bin/evn python # -*- cod ...

  4. 获取Control请求路径

    对于多个uri映射到同一个control方法时,需根据不同的uri返回的数据结构进行区分,因此需要再方法体内获取到RequestUri,再对其做相应的判断实现对应的业务逻辑 @Resource pri ...

  5. python 字符串 转 bit, bitarray 异或加密

    Python中异或加密要将str 转为 bitarray, 提示: int类型和纯数字的字符串也可以异或处理, 可能更方便 from bitarray import bitarray def str2 ...

  6. How to Read a Paper

    How to Read a Paper 原文: https://www.yuque.com/lart/papers/yrkv5u 题目:How to Read a Paper 作者:S. Keshav ...

  7. 弹飞绵羊[HNOI2010]

    --BZOJ2002 Description 某天,Lostmonkey发明了一种超级弹力装置,为了在他的绵羊朋友面前显摆,他邀请小绵羊一起玩个游戏.游戏一开始,Lostmonkey在地上沿着一条直线 ...

  8. [精华][推荐]CAS SSO单点登录服务端客户端学习

    1.通过下载稳定版本的方式下载cas的相关源码包,如下: 直接选择4.2.1的稳定代码即可 2.我们项目中的版本版本使用maven apereo远程库去下载 通过远程maven库下载cas-serve ...

  9. Android学习(三)

    学号 20189214 <Android程序开发>第八周学习总结 教材学习内容总结 GridView GridView和ListView一样是AbsListView的子类; 都需要一个Ad ...

  10. HttpServerUtility常用方法

    //HttpServerUtility是一个工具类,为了在后台处理请求方便获取到一些常用的类型,Asp.net将很多常用的东西封装到这里. // 获取服务器的计算机名称. public string ...