7

According to this answer, all that's necessary to get an unmanaged object from an existing managed object is to do this:

let unmanagedObject = Object(value: existingObject)

However, when I do this, any fields of the existingObject that are managed realm objects themselves remain managed realm objects after copying. What do I have to do so that all sub-objects of the copy also become unmanaged?

Community
  • 1
  • 1
shoe
  • 952
  • 1
  • 20
  • 44
  • hey, were you able to resolve this? I need to do the same – waheeda Jul 13 '17 at 06:13
  • @waheeda Yea, I ended up creating a `copy()` function on the object, and inside of it I created a new object, initialized all the fields manually, and then returned it – shoe Jul 15 '17 at 01:43

0 Answers0