-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
This is occurring in a large application, so we cannot provide sample code. Essentially, when copying RLMObject}}s from one Realm to another, after a few hundred objects are copied, we're experiencing a failure in {{RLMCreateObjectInRealmWithValue with EXC_BAD_ACCESS in [RLMObjectId init]. Although we have the offending code wrapped in a try/catch, it's not throwing an exception and simply killing the app. We have a stack trace which is too large to post here, so if you'd like it emailed, please provide an address.
The code used to copy objects is basic and akin to the following example;
dispatch_async(dispatch_get_global_queue(0, 0), ^ { @autoreleasepool { //Open toRealm and fromRealm... [toRealm transactionWithBlock:^ { NSArray *objectSchema = fromRealm.configuration.objectClasses; for (RLMObjectSchema *schema in objectSchema) { RLMResults<RLMObject*> *objects = [fromRealm allObjects:schema.className]; for (RLMObject *object in objects) { @try { RLMCreateObjectInRealmWithValue(toRealm, schema.className, object, RLMUpdatePolicyUpdateChanged); } @catch (NSException *exception) { //Handle exception } } } }]; } }
Realm v10.7.4
iOS: v14.5
XCode v12.5