resolve(_:)

public func resolve<Confined>(_ reference: ThreadSafeReference<Confined>) -> Confined?

Returns the same object as the one referenced when the ThreadSafeReference was first created, but resolved for the current Realm for this thread. Returns nil if this object was deleted after the reference was created.

Warning

A ThreadSafeReference object must be resolved at most once. Failing to resolve a ThreadSafeReference will result in the source version of the Realm being pinned until the reference is deallocated. An exception will be thrown if a reference is resolved more than once.

Warning

Cannot call within a write transaction.

Note

Will refresh this Realm if the source Realm was at a later version than this one.

See

ThreadSafeReference(to:)