Realm object has been deleted or invalidated
I got a really nice way to catch a RLMException within Swift.
Currently Swift doesn't show where a RLMException happened.
In Realm/RLMUtil.mm:266, there is the definition for RLMException.
If you change the code to generate a swift error,
Xcode now can show you where the exception occurred.
Now it is a part of Swift.
// Realm/RLMUtil.mm:266static NSException *RLMException(NSString *reason, NSDictionary *additionalUserInfo) { // add some code to generate a swift error. E.g. division-by-zero. int a = 0; if (reason == nil) { a = 1; } NSLog(@"calculating 1 / %d = %f", a, 1 / a); ... remainder of the original code...}