What's the correct way to instantiate an RLMObject with an array of other RLMObjects?
The docs don't mention anything and my initial attempts (do nothing, assume Realm does the right thing and create an empty array and assign that when I set my first relationship up don't seem to work.
Here's my code:
[[RLMRealm defaultRealm] beginWriteTransaction];
[_realmAnswers removeAllObjects];
NSMutableArray* newArray = [NSMutableArray arrayWithCapacity:answers.count];
for (NSString* answerString in answers){
OFEAnswerEntry* newAnswer = [[OFEAnswerEntry alloc] init];
newAnswer.answerString = answerString;
[newArray addObject:newAnswer];
}
[_realmAnswers addObjectsFromArray: newArray];
[[RLMRealm defaultRealm] commitWriteTransaction];