Skip to content

Commit f156e1f

Browse files
committed
fix: App crashes on launch and SwiftUI preview when built with Xcode 16 due to unregistered Parse subclasses (parse-community#1811)
1 parent 0f1074a commit f156e1f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,18 @@ - (void)_registerSubclassesInLoadedBundle:(NSBundle *)bundle {
345345
- (void)_registerSubclassesInBundle:(NSBundle *)bundle {
346346
PFConsistencyAssert(bundle.loaded, @"Cannot register subclasses in an unloaded bundle: %@", bundle);
347347

348-
const char *executablePath = bundle.executablePath.UTF8String;
348+
[self _registerSubclassesInExecutablePath:bundle.executablePath];
349+
350+
#if defined(DEBUG) && DEBUG
351+
if (bundle == [NSBundle mainBundle]) {
352+
NSString *executablePath = [NSString stringWithFormat:@"%@.debug.dylib", bundle.executablePath];
353+
[self _registerSubclassesInExecutablePath:executablePath];
354+
}
355+
#endif
356+
}
357+
358+
- (void)_registerSubclassesInExecutablePath:(NSString *)exePath {
359+
const char *executablePath = exePath.UTF8String;
349360
if (executablePath == NULL) {
350361
return;
351362
}

0 commit comments

Comments
 (0)