-
-
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
Updated nullability annotations and return types for synchronous methods on PFObject. #171
Conversation
LGTM |
One question: do the headers and the implementation have to match? All of this pull's fixes relate to the headers and not the implementations. For example, I've had repeated problems subclassing PFUser. I no longer try to do so. Could the change just committed to the header returning an |
I think PFUser in a good state now, but would love to hear what specific problems you are running into. |
c8c413f
to
9ba3484
Compare
Updated nullability annotations and return types for synchronous methods on PFObject.
Here's how I use For your edification, here is the header for my
Implementation:
It doesn't get much simpler than the above subclass. As I use Parse as my "cloud truth DB" and not my operational/UI DB, not having a proper subclass doesn't affect me in many places in my code. I can live with it; but it annoys me to not have a uniform pattern to access my cloud object model. The above doesn't answer your question. Frankly, this decision occurred at the beginning of the year after I ran into some login difficulty. I don't remember exactly. Reverting to the dictionary form eliminated the problem. IIRC, this was in the v1.6.x version era. I did not try with either v1.7.x or v1.8.x. Now, if you've really done things to improve the situation, I'm willing to try to subclass |
It was improved constantly and should work and is definitely a supported use case. The only piece of feedback that I have about the code above - don't overwrite Last piece to note, though I think you are aware of this: any subclass of PFObject should be explicitly registered by calling |
Thank you for your clarification. My use is as documented in the Parse subclassing guide. The docs need to be updated to specifically call out the exception of creating a custom subclass of I assume that when I call in Swift I will explore subclassing |
If these methods fail - they will return
nil
, which makes themnullable
- annotate accordingly.Also - replace more instances of direct class names with
instancetype
.Thank you @adonoho for noticing!