realm/realm-cocoa — pull request #886 by tgoyne (2014-09-10 16:04:14+00:00)
Title: Don't allow passing persisted objects to -[RLMRealm addObject:]

This didn't work correctly if the object was persisted in a different Realm (it just created an empty row rather than copying it), and `createInRealm:withObject` is a much better way to support copying objects between Realms as it doesn't involve a method doing something very different from what it normally does.

This also changes the semantics of `createInRealm:withObject:` a little: the passed object is now never mutated, while previously linked RLMObjects were added with `addObject:`, which would turn standalone RLMObjects into accessors.

@alazier