realm-swift: Object has been deleted or invalidated after remove all

Goals

Access managed object without crash

Expected Results

Access managed object without crash

Actual Results

I will remove all the datas saved in realm when user log out, however, app will crash with Object has been deleted or invalidated when log in with the same user and access data has been saved in realm. Only to access, no write.

Steps to Reproduce

No

Code Sample

Version of Realm and Tooling

Realm framework version: 2.5.1

Realm Object Server version: 2.5.1

Xcode version: 8.3

iOS/OSX version: 10.12.4

Dependency manager + version: Unknown

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

Is there any update on this? I have the same issue.

  1. Log in with user X
  2. Go to particular view where Realm is used
  3. Log out and delete all data from realm (deleteAll)
  4. Log in with user X
  5. Go back to the same view
  6. Crash