Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get an unmanaged object from a managed realm object in swift #5859

Open
debjitk opened this issue Jul 21, 2018 · 3 comments

Comments

@debjitk
Copy link

commented Jul 21, 2018

How can i get an unmanaged object from a managed realm object in swift. In java i can achieve this by calling "copyFromRealm" method. How can i achive the same in swift ?

@realm-probot realm-probot bot added the O-Community label Jul 21, 2018

@darshangulur

This comment has been minimized.

Copy link

commented Jul 30, 2018

@debjitk let unmanagedObject = ObjectType(value: managedObject) should do it for you.

@mohammdsss1

This comment has been minimized.

Copy link

commented Aug 13, 2018

@darshangulur will that work for nested objects within that instance too!

@JesusMartinAlonso

This comment has been minimized.

Copy link

commented Oct 4, 2018

let unmanagedObject = ObjectType(value: managedObject) only work for the object passed by parameter (managedObject). However, if this object has nested Realm objects, these objects still have a reference to a Realm instance. How can we return a truly unmanaged object from a managed object??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.