Skip to content

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

Merged
merged 2 commits into from
Jul 28, 2017

Conversation

mman
Copy link
Contributor

@mman mman commented Jul 26, 2017

The fix essentailly renames the original PFSubclassing.object() class method to PFSubclassing.instantiateObject() method with the same semantics to avoid being flagged by XCode 9 beta 4.

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;
Copy link
Contributor

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?

Copy link
Contributor Author

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...

Copy link
Contributor

@flovilmart flovilmart Jul 26, 2017

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?

Copy link
Contributor Author

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
@mman
Copy link
Contributor Author

mman commented Jul 27, 2017

Moved the class method PFSubclassing.object to a private category interface on PFObject, not sure if its clean but compiles and works.

@flovilmart
Copy link
Contributor

flovilmart commented Jul 27, 2017

Seems that the tests are also using it, is the method exposed on PFObject publicly?

@mman
Copy link
Contributor Author

mman commented Jul 27, 2017

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?

@flovilmart
Copy link
Contributor

go for solution 1 :)

@mman
Copy link
Contributor Author

mman commented Jul 27, 2017

solution 1 implemented, tests passing on my machine. /me learning slowly :)

@flovilmart
Copy link
Contributor

@mman better than not trying at all! 👏 👏 🙇

@flovilmart flovilmart merged commit 36ef251 into parse-community:master Jul 28, 2017
@mman mman deleted the fix-1162 branch July 28, 2017 14:49
tkhoa87 added a commit to notabasement/Parse-SDK-iOS-OSX that referenced this pull request Aug 31, 2017
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants