Hi,
Is it possible to move/copy objects between realms?
Regards,
Raul Perez
You can call -createInRealm:withObject: to create a copy of a persisted object in a second Realm.
Seems that this doesn't work on version 0.86.3.
Realm raise and exception that says that the object is already persisted on a Realm.
Regards
Calling -addObject: on objects from other Realms should fail, but calling -createInRealm:withObject: should work. We have tests for this starting here: https://github.com/realm/realm-cocoa/blob/master/Realm/Tests/RealmTests.mm#L191
Perhaps you are doing something that we are not testing? What methods/code is causing issues for you?
Here's a permalink for anyone reading this retroactively: https://github.com/realm/realm-cocoa/blob/569a6dc401b55fc273dbc3e23c63cbf02ab0a951/Realm/Tests/RealmTests.mm#L254
I'm looking for this functionality but can't find this method - only create with a dictionary. Anyone knows if it's still possible to do this, and if yes how? (Using Swift).
Most helpful comment
I'm looking for this functionality but can't find this method - only
createwith a dictionary. Anyone knows if it's still possible to do this, and if yes how? (Using Swift).