-
-
Notifications
You must be signed in to change notification settings - Fork 874
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
Added automatic PFObject subclass registration. #5
Conversation
f304933
to
2f81142
Compare
2f81142
to
cb56a6a
Compare
Fixed OSX unit tests, was an issue related to symlink resolution only happening partially. |
+1 |
3fcdc47
to
af28af7
Compare
Rebased. |
Hey guys, just letting everyone here know that we are tracking this to be merged in and release with version 1.8.4 of the SDK. |
af28af7
to
fef157a
Compare
fef157a
to
b4e5adf
Compare
Needs rebasing + tests to pass, back in your queue :) |
78160ac
to
4a46a19
Compare
@richardjrossiii updated the pull request. |
4a46a19
to
36f34bd
Compare
+1 |
This will scan all loaded code bundles for classes which inherit from `PFObject`, and register them upon Parse initialization. Still have opt-in support for manual-only registration, though it shouldn't be necessary for most cases.
36f34bd
to
11111a0
Compare
Rebased. |
Due to issues with travis CI, we've moved this issue to #967, for any who are following this PR still. |
This is a breaking change.
What's new
Currently, every
PFObject
subclass must be registered with parse before it is used. This can create some hard-to-track-down issues if you're not aware of this, and it isn't exactly the cleanest API.In Objective-C/Swift, it is relatively easy to search at run-time for subclasses of
PFObject
, and have them register with parse automatically (in the case of dynamic libraries, even as soon as they load from their bundles).This should prevent needing your app delegate to have lots of extra lines of code related to simply registering all of your
PFObject
subclasses.What's breaking
PFObject
, which implementedPFSubclassing
, but intentionally did not register it with parse (or only conditionally registered it with parse), then you may run into errors printed to the console and a crash on start. The error message in the console should be concrete enough to help you track down the issue.PFSubclassingSkipAutomaticRegistration
.[MySubclass registerSubclass]
inAppDelegate
or similar, andMySubclass
is located in a not-yet loaded dynamic library/framework, then until you manually load that library (by using a class/method/function inside it), your subclass will not be registered.dlopen
& friends, if your application needs such a feature.These breaking changes shouldn't effect 99% of our users, and workarounds should be fairly simple for those it will break for.