From 0039ad3d8491eb6269a05f0553ed5e6d2c3dd907 Mon Sep 17 00:00:00 2001 From: Martin Man Date: Thu, 27 Jul 2017 14:41:10 +0200 Subject: [PATCH 1/2] move PFSubclassing.object() class method to PFObjectPrivate.h to avoid XCode 9 error: class method object() unavailable --- Parse/Internal/Object/PFObjectPrivate.h | 16 ++++++++++++++++ Parse/PFSubclassing.h | 12 ------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Parse/Internal/Object/PFObjectPrivate.h b/Parse/Internal/Object/PFObjectPrivate.h index 5ce305ff2..c6423af64 100644 --- a/Parse/Internal/Object/PFObjectPrivate.h +++ b/Parse/Internal/Object/PFObjectPrivate.h @@ -140,6 +140,22 @@ @end +@interface PFObject () + +/** + Constructs an object of the most specific class known to implement `+parseClassName`. + + This method takes care to help `PFObject` subclasses be subclassed themselves. + For example, `PFUser.+object` returns a `PFUser` by default but will return an + 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; + +@end + @interface PFObject (Private) /** diff --git a/Parse/PFSubclassing.h b/Parse/PFSubclassing.h index 784da176f..34c588efe 100644 --- a/Parse/PFSubclassing.h +++ b/Parse/PFSubclassing.h @@ -32,18 +32,6 @@ NS_ASSUME_NONNULL_BEGIN @optional -/** - Constructs an object of the most specific class known to implement `+parseClassName`. - - This method takes care to help `PFObject` subclasses be subclassed themselves. - For example, `PFUser.+object` returns a `PFUser` by default but will return an - 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; - /** Creates a reference to an existing PFObject for use in creating associations between PFObjects. From 77509cda0aefe1fc164d69cc4ac9606cabd8e8ee Mon Sep 17 00:00:00 2001 From: Martin Man Date: Thu, 27 Jul 2017 19:08:49 +0200 Subject: [PATCH 2/2] make sure tests have access to (now private) PFObject.object() class method --- Tests/Unit/ProductTests.m | 1 + Tests/Unit/PurchaseUnitTests.m | 1 + Tests/Unit/UserUnitTests.m | 1 + 3 files changed, 3 insertions(+) diff --git a/Tests/Unit/ProductTests.m b/Tests/Unit/ProductTests.m index 221b12537..f633a107c 100644 --- a/Tests/Unit/ProductTests.m +++ b/Tests/Unit/ProductTests.m @@ -9,6 +9,7 @@ #import "PFProduct.h" #import "PFUnitTestCase.h" +#import "PFObjectPrivate.h" @interface ProductTests : PFUnitTestCase diff --git a/Tests/Unit/PurchaseUnitTests.m b/Tests/Unit/PurchaseUnitTests.m index b4194f7f5..0287b4506 100644 --- a/Tests/Unit/PurchaseUnitTests.m +++ b/Tests/Unit/PurchaseUnitTests.m @@ -19,6 +19,7 @@ #import "PFTestSKProduct.h" #import "PFUnitTestCase.h" #import "Parse_Private.h" +#import "PFObjectPrivate.h" @protocol PurchaseControllerDataSource diff --git a/Tests/Unit/UserUnitTests.m b/Tests/Unit/UserUnitTests.m index fe82e0fe7..566236041 100644 --- a/Tests/Unit/UserUnitTests.m +++ b/Tests/Unit/UserUnitTests.m @@ -9,6 +9,7 @@ #import "PFUnitTestCase.h" #import "PFUser.h" +#import "PFObjectPrivate.h" @interface UserUnitTests : PFUnitTestCase