-
-
Notifications
You must be signed in to change notification settings - Fork 871
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
Automatic loading of PFObject
subclasses does not work on Xcode 16 / iOS 18
#1792
Comments
Thanks for opening this issue!
|
Im getting subclassing error with 4.1.1 version. |
Same as @justasza here; running Xcode 16 RC — Version 16.0 (16A242) |
Bumping bounty given the impact of this issue. Anyone wants to take a look at this? |
Hey @mtrezza I believe my linked PR should solve the issue |
I've tested your code and it did fix the issue for me. Looking forward to this get merged. |
Please merge this PR asap. |
The class PFPin must be registered with registerSubclass before using Parse. I am getting this error. Is there any workaround for it? |
A closed Issue had the information on how to get Xcode to run with the Parse Swift Package, but its not here in this thread. Copying this from a closed Issue: Also - you do not need any "registerSubClass()" statements - this commit is all you need. |
The issue mentioned above is #1809 (comment). |
@dhoerl Note that this works for compiling for Simulator/Device in |
I’m using it with Production and it’s fine. |
I've been able to verify that the commit hash mentioned by dhoerl does indeed work |
Just tried #1811 and it seems to work I was able to remove all of the .registerSubclass() calls and the
is not being thrown. So the initialization called per the below code seems good.
XCode 16, macOS Sonoma. |
Could @toto or someone else confirm that this also works for SwiftUI previews? |
Great; I'll go ahead and merge |
🎉 This change has been released in version 4.1.2 |
New Issue Checklist
Issue Description
Parse iOS / OSX SDK uses
PFObject
instances for basically everything. All subclasses ofPFObject
are represented in MongoDB/PostgreSQL as collections/tables with given names. Mapping of thePFObject
subclasses and their names in MongoDB/PostreSQL need to be known to Parse SDK so thatPFObject
subclasses can be loaded/stored properly to the database.Originally registration of all classes was needed to be done manually by invoking code like this after initialising the Parse SDK:
Then came #967 that made things much simpler by scanning executable bundles (read frameworks) for all classes that are subclassing
PFObject
and registering them during SDK startup automatically.The code is here:
Parse-SDK-iOS-OSX/Parse/Parse/Internal/Object/Subclassing/PFObjectSubclassingController.m
Lines 384 to 387 in c301262
Building with Xcode 16 seems to break the functionality because
objc_copyClassNamesForImage
returns nothing.More investigation is needed. I have not yet been able to see if this is a compiler option that needs to be toggled, or some new measure preventing apps from examining available runtime classes and their properties via Objective-C runtime reflection.
Steps to reproduce
Recompile your app with Xcode 16 and try to run against iOS 18. And see if that works for you.
It fails for me with unrelated error:
This is actually an exception coming from deep inside the Parse SDK where it tries to instantiate
PFInstallation
with collection name_Installation
and failing becausePFInstallation
class was not registered.Actual Outcome
Recompiling working code using Xcode 16 breaks the app.
Workaround
For the moment registering all required classes manually seems to work around the problem:
Environment
Client
master
Server
master
The text was updated successfully, but these errors were encountered: