设为首页 加入收藏

TOP

this class is not key value coding-compliant for the key pstype.'
2017-10-11 16:05:37 】 浏览:9769
Tags:this class not key value coding-compliant for the pstype.'

2015-10-28 16:31:40.478 attendance[10644:128666] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<__NSDictionaryI 0x7fe0e047d340> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key pstype.'

错误如上,意思是该字典没有这个键,异常抛出是在这,

    [socket.writeData setValue:@(20152)
                        forKey:@"pstype"];

socket.writeData是可变的字典,添加新的键值时需要进行内存分配,最终如下解决

    socket.writeData=[NSMutableDictionary dictionaryWithCapacity:10];
    
    [socket.writeData setValue:@(20152) forKey:@"pstype"]; 
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇iOS第三方支付(支付宝) 下一篇[深入浅出Windows 10]不同平台设..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目