@@ -1110,7 +1110,7 @@ - (void)mergeFromRESTDictionary:(NSDictionary *)object withDecoder:(PFDecoder *)
1110
1110
if (localOperationSet.updatedAt != nil &&
1111
1111
[localOperationSet.updatedAt compare: remoteOperationSet.updatedAt] != NSOrderedAscending) {
1112
1112
[localOperationSet mergeOperationSet: remoteOperationSet];
1113
- } else {
1113
+ } else if (remoteOperationSet) {
1114
1114
NSUInteger index = [operationSetQueue indexOfObject: localOperationSet];
1115
1115
[remoteOperationSet mergeOperationSet: localOperationSet];
1116
1116
[operationSetQueue replaceObjectAtIndex: index withObject: remoteOperationSet];
@@ -2102,12 +2102,12 @@ - (BOOL)isDataAvailable {
2102
2102
return self._state .complete ;
2103
2103
}
2104
2104
2105
- - (void )refresh {
2106
- [self fetch ];
2105
+ - (instancetype )refresh {
2106
+ return [self fetch ];
2107
2107
}
2108
2108
2109
- - (void )refresh : (NSError **)error {
2110
- [self fetch: error];
2109
+ - (instancetype )refresh : (NSError **)error {
2110
+ return [self fetch: error];
2111
2111
}
2112
2112
2113
2113
- (void )refreshInBackgroundWithTarget : (id )target selector : (SEL )selector {
@@ -2118,12 +2118,12 @@ - (void)refreshInBackgroundWithBlock:(PFObjectResultBlock)block {
2118
2118
[self fetchInBackgroundWithBlock: block];
2119
2119
}
2120
2120
2121
- - (void )fetch {
2122
- [self fetch: nil ];
2121
+ - (instancetype )fetch {
2122
+ return [self fetch: nil ];
2123
2123
}
2124
2124
2125
- - (void )fetch : (NSError **)error {
2126
- [[self fetchInBackground ] waitForResult: error];
2125
+ - (instancetype )fetch : (NSError **)error {
2126
+ return [[self fetchInBackground ] waitForResult: error];
2127
2127
}
2128
2128
2129
2129
- (BFTask *)fetchInBackground {
@@ -2175,20 +2175,20 @@ - (void)fetchIfNeededInBackgroundWithTarget:(id)target selector:(SEL)selector {
2175
2175
#pragma mark - Fetching Many Objects
2176
2176
// /--------------------------------------
2177
2177
2178
- + (void )fetchAll : (NSArray *)objects {
2179
- [PFObject fetchAll: objects error: nil ];
2178
+ + (instancetype )fetchAll : (NSArray *)objects {
2179
+ return [PFObject fetchAll: objects error: nil ];
2180
2180
}
2181
2181
2182
- + (void )fetchAllIfNeeded : (NSArray *)objects {
2183
- [PFObject fetchAllIfNeeded: objects error: nil ];
2182
+ + (instancetype )fetchAllIfNeeded : (NSArray *)objects {
2183
+ return [PFObject fetchAllIfNeeded: objects error: nil ];
2184
2184
}
2185
2185
2186
- + (void )fetchAll : (NSArray *)objects error : (NSError **)error {
2187
- [[self fetchAllInBackground: objects] waitForResult: error];
2186
+ + (instancetype )fetchAll : (NSArray *)objects error : (NSError **)error {
2187
+ return [[self fetchAllInBackground: objects] waitForResult: error];
2188
2188
}
2189
2189
2190
- + (void )fetchAllIfNeeded : (NSArray *)objects error : (NSError **)error {
2191
- [[self fetchAllIfNeededInBackground: objects] waitForResult: error];
2190
+ + (instancetype )fetchAllIfNeeded : (NSArray *)objects error : (NSError **)error {
2191
+ return [[self fetchAllIfNeededInBackground: objects] waitForResult: error];
2192
2192
}
2193
2193
2194
2194
+ (BFTask *)fetchAllInBackground : (NSArray *)objects {
@@ -2249,12 +2249,12 @@ + (void)fetchAllIfNeededInBackground:(NSArray *)objects block:(PFArrayResultBloc
2249
2249
#pragma mark - Fetch From Local Datastore
2250
2250
// /--------------------------------------
2251
2251
2252
- - (void )fetchFromLocalDatastore {
2253
- [self fetchFromLocalDatastore: nil ];
2252
+ - (instancetype )fetchFromLocalDatastore {
2253
+ return [self fetchFromLocalDatastore: nil ];
2254
2254
}
2255
2255
2256
- - (void )fetchFromLocalDatastore : (NSError **)error {
2257
- [[self fetchFromLocalDatastoreInBackground ] waitForResult: error];
2256
+ - (instancetype )fetchFromLocalDatastore : (NSError **)error {
2257
+ return [[self fetchFromLocalDatastoreInBackground ] waitForResult: error];
2258
2258
}
2259
2259
2260
2260
- (void )fetchFromLocalDatastoreInBackgroundWithBlock : (PFObjectResultBlock)block {
0 commit comments