findLatest

abstract fun <T : BaseRealmObject> findLatest(obj: T): T?

Get latest version of an object.

Realm write transactions always operate on the latest version of data. This method makes it possible to easily find the latest version of any frozen Realm Object and return a copy of it that can be modified while inside the write block.

Note: This object is not readable outside the write block unless it has been explicitly returned from the write.

Parameters

obj

realm object to look up. Its latest state will be returned. If the object has been deleted, null will be returned.

Throws

if called on an unmanaged object.