|
LuxChat
2.0
Instant messenger for iOS
|
#import <PFObject+Subclass.h>
Class Methods | |
| (nullable PFGenericObject) | + getObjectOfClass:objectId: |
More... | |
| (nullable PFGenericObject) | + getObjectOfClass:objectId:error: |
| (nullable PFUser *) | + getUserObjectWithId: |
More... | |
| (nullable PFUser *) | + getUserObjectWithId:error: |
| (instancetype) | + queryWithClassName: |
| (instancetype) | + queryWithClassName:predicate: |
| (instancetype) | + orQueryWithSubqueries: |
More... | |
| ("Use [PFUser query] instead.") | + PARSE_DEPRECATED |
More... | |
| (void) | + clearAllCachedResults |
Protected Attributes | |
| __pad0__: NSObject<NSCopying>typedef void (^PFQueryArrayResultBlock)(NSArray<PFGenericObject> *_Nullable objects | |
| NSError *_Nullable | error |
Properties | |
| NSString * | parseClassName |
| NSInteger | limit |
More... | |
| NSInteger | skip |
| PFCachePolicy | cachePolicy |
More... | |
| NSTimeInterval | maxCacheAge |
| BOOL | hasCachedResult |
| BOOL | trace |
More... | |
Copyright (c) 2015-present, Parse, LLC. All rights reserved.
This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. An additional grant of patent rights can be found in the PATENTS file in the same directory.
Copyright (c) 2015-present, Parse, LLC. All rights reserved.
This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. An additional grant of patent rights can be found in the PATENTS file in the same directory. This category lists all methods of PFQuery class that are synchronous, but have asynchronous counterpart, Calling one of these synchronous methods could potentially block the current thread for a large amount of time, since it might be fetching from network or saving/loading data from disk.
Copyright (c) 2015-present, Parse, LLC. All rights reserved.
This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. An additional grant of patent rights can be found in the PATENTS file in the same directory. The PFQuery class defines a query that is used to query for PFObjects.
| - (instancetype) addAscendingOrder: | (NSString *) | key |
Additionally sort in ascending order by the given key.
The previous keys provided will precedence over this key.
| key | The key to order by. |
| - (instancetype) addDescendingOrder: | (NSString *) | key |
Additionally sort in descending order by the given key.
The previous keys provided will precedence over this key.
| key | The key to order by. |
| - (void) cancel |
Cancels the current network request (if any). Ensures that callbacks won't be called.
| + (void) clearAllCachedResults |
Clears the cached results for all queries.
| - (void) clearCachedResult |
Clears the cached result for this query. If there is no cached result, this is a noop.
| - (NSInteger) countObjects: | (NSError **) | error |
Counts objects synchronously based on the constructed query and sets an error if there was one.
| error | Pointer to an NSError that will be set if necessary. |
PFObject objects that match the query, or -1 if there is an error. | - (BFTask<NSNumber *> *) countObjectsInBackground |
Counts objects asynchronously and sets NSNumber with count as a result of the task.
| - (void) countObjectsInBackgroundWithBlock: | (nullable PFIntegerResultBlock) | block |
Counts objects asynchronously and calls the given block with the counts.
| block | The block to execute. It should have the following argument signature: ^(int count, NSError *error) |
| - (void) countObjectsInBackgroundWithTarget: | (nullable id) | target | |
| selector: | ("Please use `PFQuery.-countObjectsInBackgroundWithBlock:` instead.") | PARSE_DEPRECATED | |
Counts objects asynchronously and calls the given callback with the count.
| target | The object to call the selector on. |
| selector | The selector to call. It should have the following signature: (void)callbackWithResult:(NSNumber *)result error:(NSError *)error. |
PFQuery.-countObjectsInBackgroundWithBlock: instead. Provided by category PFQuery(Deprecated).
| - (nullable NSArray<PFGenericObject> *) findObjects: | (NSError **) | error |
Finds objects synchronously based on the constructed query and sets an error if there was one.
| error | Pointer to an NSError that will be set if necessary. |
PFObject objects that were found. | - (BFTask<NSArray<PFGenericObject> *> *) findObjectsInBackground |
Finds objects asynchronously and sets the NSArray of PFObject objects as a result of the task.
| - (void) findObjectsInBackgroundWithBlock: | (nullable PFQueryArrayResultBlock) | block |
Finds objects asynchronously and calls the given block with the results.
| block | The block to execute. It should have the following argument signature: ^(NSArray *objects, NSError *error) |
| - (void) findObjectsInBackgroundWithTarget: | (nullable id) | target | |
| selector: | ("Please use `PFQuery.-findObjectsInBackgroundWithBlock:` instead.") | PARSE_DEPRECATED | |
Finds objects asynchronously and calls the given callback with the results.
| target | The object to call the selector on. |
| selector | The selector to call. It should have the following signature: (void)callbackWithResult:(id)result error:(NSError *)error. Result will be nil if error is set and vice versa. |
PFQuery.-findObjectsInBackgroundWithBlock: instead. Provided by category PFQuery(Deprecated).
| - (instancetype) fromLocalDatastore |
Change the source of this query to all pinned objects.
PFQuery as the receiver. This allows method chaining.| - (instancetype) fromPin |
Change the source of this query to the default group of pinned objects.
PFQuery as the receiver. This allows method chaining.| - (instancetype) fromPinWithName: | (nullable NSString *) | name |
Change the source of this query to a specific group of pinned objects.
| name | The pinned group. |
PFQuery as the receiver. This allows method chaining.| - (nullable PFGenericObject) getFirstObject: | (NSError **) | error |
Gets an object synchronously based on the constructed query and sets an error if any occurred.
1.| error | Pointer to an NSError that will be set if necessary. |
PFObject, or nil if none was found. | - (BFTask<PFGenericObject> *) getFirstObjectInBackground |
Gets an object asynchronously and sets it as a result of the task.
1.| - (void) getFirstObjectInBackgroundWithBlock: | (nullable void(^)(PFGenericObject _Nullable object, NSError *_Nullable error)) | block |
Gets an object asynchronously and calls the given block with the result.
1.| block | The block to execute. It should have the following argument signature: ^(PFObject *object, NSError *error). result will be nil if error is set OR no object was found matching the query. error will be nil if result is set OR if the query succeeded, but found no results. |
| - (void) getFirstObjectInBackgroundWithTarget: | (nullable id) | target | |
| selector: | ("Please use `PFQuery.-getFirstObjectInBackgroundWithBlock:` instead.") | PARSE_DEPRECATED | |
Gets an object asynchronously and calls the given callback with the results.
1.| target | The object to call the selector on. |
| selector | The selector to call. It should have the following signature: (void)callbackWithResult:(PFObject *)result error:(NSError *)error. result will be nil if error is set OR no object was found matching the query. error will be nil if result is set OR if the query succeeded, but found no results. |
PFQuery.-getFirstObjectInBackgroundWithBlock: instead. Provided by category PFQuery(Deprecated).
| - (BFTask<PFGenericObject> *) getObjectInBackgroundWithId: | (NSString *) | objectId |
Gets a PFObject asynchronously and calls the given block with the result.
1, skip to 0 and remove all conditions, leaving only objectId.| objectId | The id of the object that is being requested. |
| - (void) getObjectInBackgroundWithId: | (NSString *) | objectId | |
| block: | (nullable void(^)(PFGenericObject _Nullable object, NSError *_Nullable error)) | block | |
Gets a PFObject asynchronously and calls the given block with the result.
1, skip to 0 and remove all conditions, leaving only objectId.| objectId | The id of the object that is being requested. |
| block | The block to execute. The block should have the following argument signature: ^(NSArray *object, NSError *error) |
| - (void) getObjectInBackgroundWithId: | (NSString *) | objectId | |
| target: | (nullable id) | target | |
| selector: | ("Please use `PFQuery.-getObjectInBackgroundWithId:block:` instead.") | PARSE_DEPRECATED | |
Gets a PFObject asynchronously.
This mutates the PFQuery. It will reset limit to 1, skip to 0 and remove all conditions, leaving only objectId.
| objectId | The id of the object being requested. |
| target | The target for the callback selector. |
| selector | The selector for the callback. It should have the following signature: (void)callbackWithResult:(id)result error:(NSError *)error. Result will be nil if error is set and vice versa. |
PFQuery.-getObjectInBackgroundWithId:block: instead. Provided by category PFQuery(Deprecated).
| + (nullable PFGenericObject) getObjectOfClass: | (NSString *) | objectClass | |
| objectId: | (NSString *) | PF_SWIFT_UNAVAILABLE | |
| + (nullable PFGenericObject) getObjectOfClass: | (NSString *) | objectClass | |
| objectId: | (NSString *) | objectId | |
| error: | (NSError **) | error | |
Returns a PFObject with a given class and id and sets an error if necessary.
| objectClass | The class name for the object that is being requested. |
| objectId | The id of the object that is being requested. |
| error | Pointer to an NSError that will be set if necessary. |
PFObject if found. Returns nil if the object isn't found, or if there was an error. | - (nullable PFGenericObject) getObjectWithId: | (NSString *) | PF_SWIFT_UNAVAILABLE |
Returns a PFObject with the given id.
1, skip to 0 and remove all conditions, leaving only objectId.| objectId | The id of the object that is being requested. |
PFObject if found. Returns nil if the object isn't found, or if there was an error. | - (nullable PFGenericObject) getObjectWithId: | (NSString *) | objectId | |
| error: | (NSError **) | error | |
Returns a PFObject with the given id and sets an error if necessary.
1, skip to 0 and remove all conditions, leaving only objectId.| objectId | The id of the object that is being requested. |
| error | Pointer to an NSError that will be set if necessary. |
PFObject if found. Returns nil if the object isn't found, or if there was an error. | + (nullable PFUser *) getUserObjectWithId: | (NSString *) | PF_SWIFT_UNAVAILABLE |
Returns a PFUser with a given id.
| objectId | The id of the object that is being requested. |
| + (nullable PFUser *) getUserObjectWithId: | (NSString *) | objectId | |
| error: | (NSError **) | error | |
Returns a PFUser with a given class and id and sets an error if necessary.
| objectId | The id of the object that is being requested. |
| error | Pointer to an NSError that will be set if necessary. |
| - (instancetype) ignoreACLs |
Ignore ACLs when querying from the Local Datastore.
This is particularly useful when querying for objects with Role based ACLs set on them.
PFQuery as the receiver. This allows method chaining. | - (instancetype) includeKey: | (NSString *) | key |
Make the query include PFObjects that have a reference stored at the provided key.
This has an effect similar to a join. You can use dot notation to specify which fields in the included object are also fetch.
| key | The key to load child PFObjects for. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) includeKeys: | (NSArray< NSString * > *) | keys |
| - (instancetype) initWithClassName: | (NSString *) | className |
Initializes the query with a class name.
| className | The class name. |
| - (instancetype) orderByAscending: | (NSString *) | key |
Sort the results in ascending order with the given key.
| key | The key to order by. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) orderByDescending: | (NSString *) | key |
Sort the results in descending order with the given key.
| key | The key to order by. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) orderBySortDescriptor: | (NSSortDescriptor *) | sortDescriptor |
Sort the results using a given sort descriptor.
sortDescriptor has custom selector or comparator - they aren't going to be used.| sortDescriptor | The NSSortDescriptor to use to sort the results of the query. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) orderBySortDescriptors: | (nullable NSArray< NSSortDescriptor * > *) | sortDescriptors |
Sort the results using a given array of sort descriptors.
sortDescriptor has custom selector or comparator - they aren't going to be used.| sortDescriptors | An array of NSSortDescriptor objects to use to sort the results of the query. |
PFQuery as the receiver. This allows method chaining. | + (instancetype) orQueryWithSubqueries: | (NSArray< PFQuery * > *) | queries |
| + ("Use [PFUser query] instead.") PARSE_DEPRECATED |
| - (nullable PFGenericObject) PF_SWIFT_UNAVAILABLE |
Gets an object synchronously based on the constructed query.
1.PFObject, or nil if none was found. | - (NSInteger) PF_SWIFT_UNAVAILABLE |
Counts objects synchronously based on the constructed query.
PFObject objects that match the query, or -1 if there is an error. | - (nullable NSArray<PFGenericObject> *) PF_SWIFT_UNAVAILABLE |
Finds objects synchronously based on the constructed query.
PFObject objects that were found. | + (instancetype) queryWithClassName: | (NSString *) | className |
| + (instancetype) queryWithClassName: | (NSString *) | className | |
| predicate: | (nullable NSPredicate *) | predicate | |
Creates a PFQuery with the constraints given by predicate.
The following types of predicates are supported:
=, !=, <, >, <=, >=, and BETWEEN with a key and a constant.x IN {1, 2, 3}.x IN SELF.AND, OR, and NOT.key IN %@, subquery.The following types of predicates are NOT supported:
ANY, SOME, ALL, or NONE.LIKE, MATCHES, CONTAINS, or ENDSWITH.| className | The class to query on. |
| predicate | The predicate to create conditions from. |
| - (instancetype) selectKeys: | (NSArray< NSString * > *) | keys |
Make the query restrict the fields of the returned PFObjects to include only the provided keys.
If this is called multiple times, then all of the keys specified in each of the calls will be included.
| keys | The keys to include in the result. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) whereKey: | (NSString *) | key | |
| containedIn: | (NSArray *) | array | |
Add a constraint to the query that requires a particular key's object to be contained in the provided array.
| key | The key to be constrained. |
| array | The possible values for the key's object. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) whereKey: | (NSString *) | key | |
| containsAllObjectsInArray: | (NSArray *) | array | |
Add a constraint to the query that requires a particular key's array contains every element of the provided array.
| key | The key to be constrained. |
| array | The array of values to search for. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) whereKey: | (NSString *) | key | |
| containsString: | (nullable NSString *) | substring | |
Add a constraint for finding string values that contain a provided substring.
| key | The key that the string to match is stored in. |
| substring | The substring that the value must contain. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) whereKey: | (NSString *) | key | |
| doesNotMatchKey: | (NSString *) | otherKey | |
| inQuery: | (PFQuery *) | query | |
Adds a constraint that requires that a key's value NOT match a value in another key in objects returned by a sub query.
| key | The key that the value is stored. |
| otherKey | The key in objects in the returned by the sub query whose value should match. |
| query | The query to run. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) whereKey: | (NSString *) | key | |
| doesNotMatchQuery: | (PFQuery *) | query | |
| - (instancetype) whereKey: | (NSString *) | key | |
| equalTo: | (id) | object | |
Add a constraint to the query that requires a particular key's object to be equal to the provided object.
| key | The key to be constrained. |
| object | The object that must be equalled. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) whereKey: | (NSString *) | key | |
| greaterThan: | (id) | object | |
Add a constraint to the query that requires a particular key's object to be greater than the provided object.
| key | The key to be constrained. |
| object | The object that must be equalled. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) whereKey: | (NSString *) | key | |
| greaterThanOrEqualTo: | (id) | object | |
Add a constraint to the query that requires a particular key's object to be greater than or equal to the provided object.
| key | The key to be constrained. |
| object | The object that must be equalled. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) whereKey: | (NSString *) | key | |
| hasPrefix: | (nullable NSString *) | prefix | |
Add a constraint for finding string values that start with a provided prefix.
This will use smart indexing, so it will be fast for large datasets.
| key | The key that the string to match is stored in. |
| prefix | The substring that the value must start with. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) whereKey: | (NSString *) | key | |
| hasSuffix: | (nullable NSString *) | suffix | |
Add a constraint for finding string values that end with a provided suffix.
| key | The key that the string to match is stored in. |
| suffix | The substring that the value must end with. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) whereKey: | (NSString *) | key | |
| lessThan: | (id) | object | |
Add a constraint to the query that requires a particular key's object to be less than the provided object.
| key | The key to be constrained. |
| object | The object that provides an upper bound. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) whereKey: | (NSString *) | key | |
| lessThanOrEqualTo: | (id) | object | |
Add a constraint to the query that requires a particular key's object to be less than or equal to the provided object.
| key | The key to be constrained. |
| object | The object that must be equalled. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) whereKey: | (NSString *) | key | |
| matchesKey: | (NSString *) | otherKey | |
| inQuery: | (PFQuery *) | query | |
Adds a constraint that requires that a key's value matches a value in another key in objects returned by a sub query.
| key | The key that the value is stored. |
| otherKey | The key in objects in the returned by the sub query whose value should match. |
| query | The query to run. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) whereKey: | (NSString *) | key | |
| matchesQuery: | (PFQuery *) | query | |
| - (instancetype) whereKey: | (NSString *) | key | |
| matchesRegex: | (NSString *) | regex | |
Add a regular expression constraint for finding string values that match the provided regular expression.
| key | The key that the string to match is stored in. |
| regex | The regular expression pattern to match. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) whereKey: | (NSString *) | key | |
| matchesRegex: | (NSString *) | regex | |
| modifiers: | (nullable NSString *) | modifiers | |
Add a regular expression constraint for finding string values that match the provided regular expression.
| key | The key that the string to match is stored in. |
| regex | The regular expression pattern to match. |
| modifiers | Any of the following supported PCRE modifiers:
|
PFQuery as the receiver. This allows method chaining. | - (instancetype) whereKey: | (NSString *) | key | |
| nearGeoPoint: | (PFGeoPoint *) | geopoint | |
Add a constraint to the query that requires a particular key's coordinates (specified via PFGeoPoint) be near a reference point.
Distance is calculated based on angular distance on a sphere. Results will be sorted by distance from reference point.
| key | The key to be constrained. |
| geopoint | The reference point represented as a PFGeoPoint. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) whereKey: | (NSString *) | key | |
| nearGeoPoint: | (PFGeoPoint *) | geopoint | |
| withinKilometers: | (double) | maxDistance | |
Add a constraint to the query that requires a particular key's coordinates (specified via PFGeoPoint) be near a reference point and within the maximum distance specified (in kilometers).
Distance is calculated based on a spherical coordinate system. Results will be sorted by distance (nearest to farthest) from the reference point.
| key | The key to be constrained. |
| geopoint | The reference point represented as a PFGeoPoint. |
| maxDistance | Maximum distance in kilometers. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) whereKey: | (NSString *) | key | |
| nearGeoPoint: | (PFGeoPoint *) | geopoint | |
| withinMiles: | (double) | maxDistance | |
Add a constraint to the query that requires a particular key's coordinates (specified via PFGeoPoint) be near a reference point and within the maximum distance specified (in miles).
Distance is calculated based on a spherical coordinate system. Results will be sorted by distance (nearest to farthest) from the reference point.
| key | The key to be constrained. |
| geopoint | The reference point represented as a PFGeoPoint. |
| maxDistance | Maximum distance in miles. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) whereKey: | (NSString *) | key | |
| nearGeoPoint: | (PFGeoPoint *) | geopoint | |
| withinRadians: | (double) | maxDistance | |
Add a constraint to the query that requires a particular key's coordinates (specified via PFGeoPoint) be near a reference point and within the maximum distance specified (in radians). Distance is calculated based on angular distance on a sphere. Results will be sorted by distance (nearest to farthest) from the reference point.
| key | The key to be constrained. |
| geopoint | The reference point as a PFGeoPoint. |
| maxDistance | Maximum distance in radians. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) whereKey: | (NSString *) | key | |
| notContainedIn: | (NSArray *) | array | |
Add a constraint to the query that requires a particular key's object not be contained in the provided array.
| key | The key to be constrained. |
| array | The list of values the key's object should not be. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) whereKey: | (NSString *) | key | |
| notEqualTo: | (id) | object | |
Add a constraint to the query that requires a particular key's object to be not equal to the provided object.
| key | The key to be constrained. |
| object | The object that must not be equalled. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) whereKey: | (NSString *) | key | |
| withinGeoBoxFromSouthwest: | (PFGeoPoint *) | southwest | |
| toNortheast: | (PFGeoPoint *) | northeast | |
Add a constraint to the query that requires a particular key's coordinates (specified via PFGeoPoint) be contained within a given rectangular geographic bounding box.
| key | The key to be constrained. |
| southwest | The lower-left inclusive corner of the box. |
| northeast | The upper-right inclusive corner of the box. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) whereKeyDoesNotExist: | (NSString *) | key |
Add a constraint that requires a key not exist.
| key | The key that should not exist. |
PFQuery as the receiver. This allows method chaining. | - (instancetype) whereKeyExists: | (NSString *) | key |
Add a constraint that requires a particular key exists.
| key | The key that should exist. |
PFQuery as the receiver. This allows method chaining.
|
readwritenonatomicassign |
The cache policy to use for requests.
Not allowed when Pinning is enabled.
|
readnonatomicassign |
Returns whether there is a cached result for this query.
YES if there is a cached result for this query, otherwise NO.
|
readwritenonatomicassign |
A limit on the number of objects to return. The default limit is 100, with a maximum of 1000 results being returned at a time.
findObjects with limit = 1, you may find it easier to use getFirst instead.
|
readwritenonatomicassign |
The age after which a cached value will be ignored
|
readwritenonatomicstrong |
The class name to query for.
|
readwritenonatomicassign |
The number of objects to skip before returning any.
|
readwritenonatomicassign |
Whether or not performance tracing should be done on the query.
YES in most cases.
1.8.9.1