Clear complete Realm Database

后端 未结 6 2038
半阙折子戏
半阙折子戏 2020-12-24 11:45

I\'m playing around with realm (currently 0.85.0) and my application uses the database to store user-specific data such as the contacts of the current user. When the user de

6条回答
  •  [愿得一人]
    2020-12-24 12:06

    As of realm 0.87.0, it's now possible to delete all realm contents by calling [[RLMRealm defaultRealm] deleteAllObjects] from a write transaction.

    From Swift, it looks like this: RLMRealm.defaultRealm().deleteAllObjects()

提交回复
热议问题