1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Swift the realm is already in a write transaction

Posted at

the realm is already in a write transaction と言われたとき。

realmの処理が落ちきっていないんですかね。処理自体は完遂されていると思うんですが。
僕にはわからん。

try! realm.write {
    /* ... */
    realm.cancelWrite() // 処理を止めて
    realm.beginWrite() // また始める
    /* ... */
}

これでエラーが出なくなった。
エラーが起こる原因もこれで通る理由もよくわかっていないのは釈然しないがどうしてもというときは。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?