From ea4849ecab96219cda31dc66561d908cad82dedf Mon Sep 17 00:00:00 2001 From: Yao Fan Date: Wed, 25 Sep 2024 10:46:04 -0700 Subject: [PATCH] Fix Xcode 16 crash on app startup --- .../Subclassing/PFObjectSubclassingController.m | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Parse/Parse/Internal/Object/Subclassing/PFObjectSubclassingController.m b/Parse/Parse/Internal/Object/Subclassing/PFObjectSubclassingController.m index 07f6adba3..affbaec9a 100644 --- a/Parse/Parse/Internal/Object/Subclassing/PFObjectSubclassingController.m +++ b/Parse/Parse/Internal/Object/Subclassing/PFObjectSubclassingController.m @@ -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; }