Skip to content

Commit

Permalink
fix: App crashes on launch and SwiftUI preview when built with Xcode …
Browse files Browse the repository at this point in the history
…16 due to unregistered Parse subclasses (#1811)
  • Loading branch information
fysteven authored Oct 14, 2024
1 parent 907f73f commit d363a78
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,18 @@ - (void)_registerSubclassesInLoadedBundle:(NSBundle *)bundle {
- (void)_registerSubclassesInBundle:(NSBundle *)bundle {
PFConsistencyAssert(bundle.loaded, @"Cannot register subclasses in an unloaded bundle: %@", bundle);

const char *executablePath = bundle.executablePath.UTF8String;
[self _registerSubclassesInExecutablePath:bundle.executablePath];

#if defined(DEBUG) && DEBUG
if (bundle == [NSBundle mainBundle]) {
NSString *executablePath = [NSString stringWithFormat:@"%@.debug.dylib", bundle.executablePath];
[self _registerSubclassesInExecutablePath:executablePath];
}
#endif
}

- (void)_registerSubclassesInExecutablePath:(NSString *)exePath {
const char *executablePath = exePath.UTF8String;
if (executablePath == NULL) {
return;
}
Expand Down

0 comments on commit d363a78

Please sign in to comment.