Let's assume i have a database with following structure:
@interface User: RLMObject
RLMArray<Match>* matches;
@end
@interface Match: RLMObject
RLMArray<Round>* rounds;
RLMArray<User>* players;
@end
@interface Round: RLMObject
User* nextMoveUser;
@end
And i would like to update existing User object, that is already managed in Realm with all nested properties:
User* user = ... // Get unmanaged User,
// parsed from API
// with unmanaged parsed nested mathces and round
RLMRealm* realm = [RLMRealm defaultRealm];
[realm beginWriteTransaction];
[realm addOrUpdateObject: user];
[realm commitWriteTransaction];
The question is: would Realm update all nested objects as well as the main one User? P.S.: I am asking this, because I'm facing some troubles with updating [Round nextMoveUser]. It becomes nil after update. Though the debugger show that is everything allright with parsed entity.
Also i would uppreciate if some one could explain, how things work internally, when it comes to such types of references.