我的模型:
转化率
#import <Realm/Realm.h>
#import "ConvText.h"
@interface Conv : RLMObject
@property NSInteger c_id;
@property RLMArray<ConvText> *cts;
@end
转换文本.h
#import <Realm/Realm.h>
@interface ConvText : RLMObject
@property NSInteger ct_id;
@property NSInteger time;
@end
RLM_ARRAY_TYPE(ConvText)
当我试图从Conv中提取ConvTexts时:
Conv *c = [Conv objectsWhere:@"c_id = %@",@(1)];
ConvText *ct = [c.cts arraySortedByProperty:@"time" ascending:NO][0]; <--
我收到此消息:'RLMException',原因:'此方法只能在从 RLMRealm 检索的 RLMArray 实例中调用'
我也尝试这样:
RLMArray *cts = c.cts;
ConvText *ct = [cts arraySortedByProperty:@"time" ascending:NO][0];