Inherits from RLMRealm : NSObject
Declared in

Instance Methods


Begins a write transaction in an RLMRealm.

- (void)beginWriteTransaction


Only one write transaction can be open at a time. Write transactions cannot be nested, and trying to begin a write transaction on a RLMRealm which is already in a write transaction with throw an exception. Calls to beginWriteTransaction from RLMRealm instances in other threads will block until the current write transaction completes.

Before beginning the write transaction, beginWriteTransaction updates the RLMRealm to the latest Realm version, as if refresh was called, and generates notifications if applicable. This has no effect if the RLMRealm was already up to date.

It is rarely a good idea to have write transactions span multiple cycles of the run loop, but if you do wish to do so you will need to ensure that the RLMRealm in the write transaction is kept alive until the write transaction is committed.

Declared In