我有一个主领域对象:

@interface MasterRealmObject : RLMObject

@property (nonatomic, strong) RLMArray<IDNameRealmObject *><IDNameRealmObject> *retailerType;

@property (nonatomic, strong) RLMArray<IDNameRealmObject *><IDNameRealmObject> *firmType;

@property (nonatomic, strong) RLMArray<IDNameRealmObject *><IDNameRealmObject> *businessAge;

@property (nonatomic, strong) RLMArray<StateRealmObject *><StateRealmObject> *state;

@property (nonatomic, strong) RLMArray<KYCDocsRealmObject *><KYCDocsRealmObject> *kycDocs;

@property (nonatomic, strong) RLMArray<ProofRealmObject *><ProofRealmObject> *businessDocs;

@property (nonatomic, strong) NSString *ReligareTollFreeNumber;

@end

我正在尝试从以下字典中存储值:
-(void)insertMasterAPIObjects:(NSDictionary *)masterDictionary
{

    RLMRealm *realmInsertMasterObjects = [RLMRealm defaultRealm];
    [realmInsertMasterObjects beginWriteTransaction];

    MasterRealmObject *masterRealm = [[MasterRealmObject alloc]init];
    masterRealm.retailerType = [masterDictionary objectForKey:@"retailer_type"];
    masterRealm.firmType = [masterDictionary objectForKey:@"firm_type"];
    masterRealm.businessAge = [masterDictionary objectForKey:@"BusinessAge"];
    masterRealm.kycDocs = [masterDictionary objectForKey:@"kyc_docs"];
    masterRealm.businessDocs = [masterDictionary objectForKey:@"business_docs"];
    masterRealm.state = [masterDictionary objectForKey:@"states"];

    [realmInsertMasterObjects addObject:masterRealm];
    [realmInsertMasterObjects commitWriteTransaction];
}

我在此方法的第一行遇到此异常。

最佳答案

我遇到了类似的问题,因为我省略了

RLM_ARRAY_TYPE(IDNameRealmObject)
RLM_ARRAY_TYPE(StateRealmObject)
RLM_ARRAY_TYPE(KYCDocsRealmObject)
RLM_ARRAY_TYPE(ProofRealmObject)

@interface声明之前的宏。

10-07 19:27