美文网首页
this this class is not key value

this this class is not key value

作者: 女山湖小伙子 | 来源:发表于2017-08-09 10:16 被阅读136次

    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"];

    相关文章

      网友评论

          本文标题:this this class is not key value

          本文链接:https://www.haomeiwen.com/subject/pnvafxtx.html