Uploaded image for project: 'Realm Cocoa SDK'
  1. Realm Cocoa SDK
  2. RCOCOA-1002

Make realm.resolve() work on frozen objects

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None

      When working with frozen objects, it often happens that you need to convert them back into live objects (this comes up every time you need to modify them, or just make sure that you have the latest version).

      Today you can do that by first creating a ThreadSafeReference and then using realm.resolve() to get the live object:

      realm.resolve(ThreadSafeReference(to: frozenItem))
      

      This works, but it is not documented anywhere, and not very intuitive to a casual developer. It would be nice if we could have an overload of the resolve method that worked on a frozen objects directly, so it would instead just be:

      realm.resolve(frozenItem)
      

            Assignee:
            eric.mossman@mongodb.com Eric Mossman (Inactive)
            Reporter:
            alexander.stigsen@mongodb.com Alexander Stigsen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: