Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: App crashes on launch and SwiftUI preview when built with Xcode 16 due to unregistered Parse subclasses #1811

Merged
merged 3 commits into from
Oct 14, 2024

Conversation

fysteven
Copy link
Contributor

@fysteven fysteven commented Sep 25, 2024

New Pull Request Checklist

Issue Description

App crashes on app startup when built with Xcode 16:

The class PFPin must be registered with registerSubclass before using Parse

Closes: #1792

Approach

Starting Xcode 16, Apple adds this new build setting in Xcode: ENABLE_DEBUG_DYLIB, enabled by default.

Per Apple's doc:

If enabled, debug builds of app and app extension targets on supported platforms and SDKs will be built with the main binary code in a separate “NAME.debug.dylib”.

When getting class names from a binary, we should check on the "NAME.debug.dylib" binary file as well, instead of assuming the "NAME" binary file.

TODOs before merging

  • Add tests
  • Add changes to documentation (guides, repository pages, in-code descriptions)

Copy link

parse-github-assistant bot commented Sep 25, 2024

Thanks for opening this pull request!

  • 🎉 We are excited about your hands-on contribution!

@fysteven fysteven changed the title Fix Xcode 16 crash on app startup Fix Xcode 16 crash on app startup: "The class PFPin must be registered with registerSubclass before using Parse" Sep 25, 2024
@fysteven fysteven changed the title Fix Xcode 16 crash on app startup: "The class PFPin must be registered with registerSubclass before using Parse" Fix: Xcode 16 crash on app startup: "The class PFPin must be registered with registerSubclass before using Parse" Sep 25, 2024
@fysteven fysteven changed the title Fix: Xcode 16 crash on app startup: "The class PFPin must be registered with registerSubclass before using Parse" fix: Xcode 16 crash on app startup: "The class PFPin must be registered with registerSubclass before using Parse" Sep 25, 2024
Copy link

codecov bot commented Sep 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.81%. Comparing base (dd05d41) to head (4815b9c).
Report is 24 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1811       +/-   ##
===========================================
+ Coverage   64.24%   82.81%   +18.56%     
===========================================
  Files         201      282       +81     
  Lines       23233    30717     +7484     
===========================================
+ Hits        14926    25438    +10512     
+ Misses       8307     5279     -3028     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mtrezza mtrezza requested a review from a team October 3, 2024 19:49
@mtrezza mtrezza changed the title fix: Xcode 16 crash on app startup: "The class PFPin must be registered with registerSubclass before using Parse" fix: Xcode 16 crash on app startup: "The class must be registered with registerSubclass before using Parse" Oct 14, 2024
@mtrezza mtrezza changed the title fix: Xcode 16 crash on app startup: "The class must be registered with registerSubclass before using Parse" fix: App crashes on start-up when built with Xcode 16 due to unregistered Parse subclasses Oct 14, 2024
@mtrezza
Copy link
Member

mtrezza commented Oct 14, 2024

Confirmed to work, #1792 (comment), #1792 (comment)

@mtrezza mtrezza changed the title fix: App crashes on start-up when built with Xcode 16 due to unregistered Parse subclasses fix: App crashes on start-up and SwiftUI preview when built with Xcode 16 due to unregistered Parse subclasses Oct 14, 2024
@mtrezza mtrezza changed the title fix: App crashes on start-up and SwiftUI preview when built with Xcode 16 due to unregistered Parse subclasses fix: Crash on app launch and SwiftUI preview when built with Xcode 16 due to unregistered Parse subclasses Oct 14, 2024
@mtrezza mtrezza changed the title fix: Crash on app launch and SwiftUI preview when built with Xcode 16 due to unregistered Parse subclasses fix: App crashes on launch and SwiftUI preview when built with Xcode 16 due to unregistered Parse subclasses Oct 14, 2024
@mtrezza mtrezza merged commit d363a78 into parse-community:master Oct 14, 2024
10 checks passed
parseplatformorg pushed a commit that referenced this pull request Oct 14, 2024
## [4.1.2](4.1.1...4.1.2) (2024-10-14)

### Bug Fixes

* App crashes on launch and SwiftUI preview when built with Xcode 16 due to unregistered Parse subclasses ([#1811](#1811)) ([d363a78](d363a78))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 4.1.2

@parseplatformorg parseplatformorg added the state:released Released as stable version label Oct 14, 2024
mman added a commit to mman/Parse-SDK-iOS-OSX that referenced this pull request Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatic loading of PFObject subclasses does not work on Xcode 16 / iOS 18
3 participants