Skip to content

Commit d363a78

Browse files
authored
fix: App crashes on launch and SwiftUI preview when built with Xcode 16 due to unregistered Parse subclasses (#1811)
1 parent 907f73f commit d363a78

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Parse/Parse/Internal/Object/Subclassing/PFObjectSubclassingController.m

+12-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,18 @@ - (void)_registerSubclassesInLoadedBundle:(NSBundle *)bundle {
357357
- (void)_registerSubclassesInBundle:(NSBundle *)bundle {
358358
PFConsistencyAssert(bundle.loaded, @"Cannot register subclasses in an unloaded bundle: %@", bundle);
359359

360-
const char *executablePath = bundle.executablePath.UTF8String;
360+
[self _registerSubclassesInExecutablePath:bundle.executablePath];
361+
362+
#if defined(DEBUG) && DEBUG
363+
if (bundle == [NSBundle mainBundle]) {
364+
NSString *executablePath = [NSString stringWithFormat:@"%@.debug.dylib", bundle.executablePath];
365+
[self _registerSubclassesInExecutablePath:executablePath];
366+
}
367+
#endif
368+
}
369+
370+
- (void)_registerSubclassesInExecutablePath:(NSString *)exePath {
371+
const char *executablePath = exePath.UTF8String;
361372
if (executablePath == NULL) {
362373
return;
363374
}

0 commit comments

Comments
 (0)