美文网首页
iOS coreData keypath not foun

iOS coreData keypath not foun

作者: 聆听随风 | 来源:发表于2019-12-30 16:28 被阅读0次

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'keypath test06 not found in entity <NSSQLEntity LDConversation id=1>'


NSString *filterStr = [NSString stringWithFormat:@" conID  = %@", conversationModel.conID];

NSPredicate *predicate = [NSPredicate predicateWithFormat:filterString];

        request.predicate = predicate;

上面的查询会报错,

改成 NSString *filterStr = [NSString stringWithFormat:@" conID  = '%@'", conversationModel.conID];

字符串查询条件需要添加单引号。

相关文章

网友评论

      本文标题:iOS coreData keypath not foun

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