Open tachang opened 6 years ago
After loading up Realm using Pod so I had the source it turned out it was this code:
try {
// Make sure we've discovered all classes
{
unsigned int numClasses;
using malloc_ptr = std::unique_ptr<__unsafe_unretained Class[], decltype(&free)>;
malloc_ptr classes(objc_copyClassList(&numClasses), &free);
RLMRegisterClassLocalNames(classes.get(), numClasses);
}
[s_localNameToClass enumerateKeysAndObjectsUsingBlock:^(NSString *, Class cls, BOOL *) {
RLMRegisterClass(cls);
}];
}
catch (...) {
s_sharedSchemaState = SharedSchemaState::Uninitialized;
throw;
}
Is there anyway to make the throw give a better error message? It turned out that it was erroring out in RLMRegisterClass. The class I had used a point type that I didn't have as a Realm object yet so it just completely broke.
@tachang So to be clear, you have fixed your problem, but suggest to improve the error handling? Does the new title reflect it properly?
Seems like an easy starter task
Goals
I want to initialize realm and not have it crash.
Expected Results
I expect it to not crash the app on startup.
Actual Results
Steps to Reproduce
Inside AppDelegate.m put
Code Sample
Version of Realm and Tooling