Reputation: 21
I have a master realm object:
@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
I'm trying to store values from a Dictionary as below:
-(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];
}
I'm getting this exception here on the first line in this method.
Upvotes: 1
Views: 1475
Reputation: 1579
I hit a similar problem because I had omitted the
RLM_ARRAY_TYPE(IDNameRealmObject)
RLM_ARRAY_TYPE(StateRealmObject)
RLM_ARRAY_TYPE(KYCDocsRealmObject)
RLM_ARRAY_TYPE(ProofRealmObject)
macros before my @interface declaration.
Upvotes: 2