我是Realm的新手,我正在尝试将Realm与Firebase集成。我正在使用谓词使用领域获取数据。
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"isArchived == NO AND userId == %@", [User userId]];
RLMResults *dbrecents = [[Recent objectsWithPredicate:predicate] sortedResultsUsingProperty:FRECENT_LASTMESSAGEDATE ascending:NO];
和我的firebase数据结构,
我的Recent
对象具有与firebase结构完全相同的值,
@property NSString *objectId;
@property NSString *userId;
@property NSString *groupId;
@property NSString *initials;
@property NSString *picture;
@property NSString *description;
@property NSString *members;
@property NSString *password;
@property NSString *type;
@property NSString *fullname;
@property NSString *senderName;
@property NSInteger counter;
@property NSString *lastMessage;
@property NSTimeInterval lastMessageDate;
@property BOOL isArchived;
@property BOOL isDeleted;
@property BOOL message_me;
@property NSTimeInterval createdAt;
@property NSTimeInterval updatedAt;
当我检索数据时,dbrecents
为空。我该如何解决这个问题?