-
-
Notifications
You must be signed in to change notification settings - Fork 878
Fix #1162 - PFSubclassing.object() class method unavailable since XCode 9 beta 4 #1164
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
Conversation
Parse/PFSubclassing.h
Outdated
object of a registered subclass instead if one is known. | ||
A default implementation is provided by `PFObject` which should always be sufficient. | ||
|
||
@return Returns the object that is instantiated. | ||
*/ | ||
+ (instancetype)object; | ||
+ (instancetype)instantiateObject; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, A default implementation is provided by `PFObject` which should always be sufficient.
So it should be good to remove in PFSubclassing altogether no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried removing it but it's actually used by internal PFInstallation controller somewhere so it will need to be moved to either a private header or a private interface of PFInstallation at least.
I do not use it myself and don't have enough experience to assess whether it's safe to remove it from the interface, but from what I could gather studying the docs the point was to register custom subclasses of PFInstallation and PFUser before initializing Parse API and getting the custom subclasses returned from the SDK, although I found it only being used for PFInstallation in fact...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so let's make it private no? it's handled in PFObject.h right but not exposed publicly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, let me jump on it and retest it properly tomorrow...
…d XCode 9 error: class method object() unavailable
Moved the class method PFSubclassing.object to a private category interface on PFObject, not sure if its clean but compiles and works. |
Seems that the tests are also using it, is the method exposed on PFObject publicly? |
I've moved it to PFObjectPrivate.h which is never exposed to swift. From what I could see the moment +object() is exposed via public header to swift the compiler will start complaining. Solution 1: include PFObjectPrivate in tests. Solution 2: Keep the methods public in PFSubclassing.h and rename it everywhere. Ideas? |
go for solution 1 :) |
solution 1 implemented, tests passing on my machine. /me learning slowly :) |
@mman better than not trying at all! 👏 👏 🙇 |
…1.15.2 * commit '37aee695cf654c519243adc2945161a089855029': ⚡ Release 1.15.2 Fixes issue related to heap corruption (parse-community#1170) Fix parse-community#1162 - PFSubclassing.object() class method unavailable since XCode 9 beta 4 (parse-community#1164)
The fix essentailly renames the original
PFSubclassing.object()
class method toPFSubclassing.instantiateObject()
method with the same semantics to avoid being flagged by XCode 9 beta 4.