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

Automatic loading of PFObject subclasses does not work on Xcode 16 / iOS 18 #452

Open
4 tasks done
sjmckee opened this issue Nov 6, 2024 · 1 comment
Open
4 tasks done
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@sjmckee
Copy link

sjmckee commented Nov 6, 2024

New Issue Checklist

Issue Description

ParseSwift uses PFObject instances for basically everything. All subclasses of PFObject are represented in MongoDB/PostgreSQL as collections/tables with given names. Mapping of the PFObject subclasses and their names in MongoDB/PostreSQL need to be known to Parse SDK so that PFObject subclasses can be loaded/stored properly to the database.

Prior to Xcode 16, there was no need to manually register any classes explicitly subclass PFSubclassing. After upgrading, the following error occurs when running the application:
Thread 1: "The class My_App.MyParseSubclass must be registered with registerSubclass before using Parse."

Here is a link to a similar issue the Parse-SDK-iOS-OSX project: parse-community/Parse-SDK-iOS-OSX#1792

Steps to reproduce

Build and run an application with subclasses of PFSublassing using Xcode 16.

Actual Outcome

Thread 1: "The class My_App.MyParseSubclass must be registered with registerSubclass before using Parse."

Workaround

Manually register each object subclassing PFSubclassing directly after Parse Swift initialization:

let configuration = ParseClientConfiguration {
      $0.applicationId = "mapped"
      $0.server = "https://myserver/myparseinstance"
  }
  Parse.initialize(with: configuration)
       
  MyParseSubclass.registerSubclass()

Expected Outcome

App functioning properly without any subclassing errors.

Environment

Client

  • Parse Swift SDK version: 4.14.2
  • Xcode version: 16.0
  • Operating system (iOS, macOS, watchOS, etc.): iOS
  • Operating system version: 18

Server

  • Parse Server version: 7.2.0
  • Operating system: Windows
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): local

Database

  • System (MongoDB or Postgres): Postgres
  • Database version: 14.13
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): local

Logs

Copy link

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@mtrezza mtrezza added the type:bug Impaired feature or lacking behavior that is likely assumed label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

2 participants