iOS coreData keypath not foun

2019-12-30  本文已影响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];

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

上一篇下一篇

猜你喜欢

热点阅读