NSFetchRequestExpression Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/CoreData.framework |
| Availability | Available in OS X v10.5 and later. |
| Declared in | NSFetchRequestExpression.h |
| Companion guides |
Overview
Instances of NSFetchRequestExpression represent expressions which evaluate to the result of executing a fetch request on a managed object context.
NSFetchRequestExpression inherits from NSExpression, which provides most of the basic behavior. The first argument must be an expression which evaluates to an NSFetchRequest object, and the second must be an expression which evaluates to an NSManagedObjectContext object. If you simply want the count for the request, the countOnly argument should be YES.
Class Methods
expressionForFetch:context:countOnly:
Returns an expression which will evaluate to the result of executing a fetch request on a context.
Parameters
- fetch
An expression that evaluates to an instance of
NSFetchRequest.- context
An expression that evaluates to an instance of
NSManagedObjectContext.- countFlag
If
YES, when the new expression is evaluated the managed object context (from context) will performcountForFetchRequest:error:with the fetch request (from fetch). IfNO, when the new expression is evaluated the managed object context will performexecuteFetchRequest:error:with the fetch request.
Return Value
An expression which will evaluate to the result of executing a fetch request (from fetch) on a managed object context (from context).
Availability
- Available in OS X v10.5 and later.
Declared In
NSFetchRequestExpression.hInstance Methods
contextExpression
Returns the expression for the receiver’s managed object context.
Return Value
The expression for the receiver’s managed object context. Evaluating the expression must return an NSManagedObjectContext object.
Availability
- Available in OS X v10.5 and later.
Declared In
NSFetchRequestExpression.hisCountOnlyRequest
Returns a Boolean value that indicates whether the receiver represents a count-only fetch request.
Return Value
YES if the receiver represents a count-only fetch request, otherwise NO.
Discussion
If this method returns NO, the managed object context (from the contextExpression) will perform executeFetchRequest:error:: with the requestExpression; if this method returns YES, the managed object context will perform countForFetchRequest:error: with the requestExpression.
Availability
- Available in OS X v10.5 and later.
Declared In
NSFetchRequestExpression.hrequestExpression
Returns the expression for the receiver’s fetch request.
Return Value
The expression for the receiver’s fetch request. Evaluating the expression must return an NSFetchRequest object.
Availability
- Available in OS X v10.5 and later.
Declared In
NSFetchRequestExpression.hConstants
Fetch request expression type
This constant specifies the fetch request expression type.
enum {
NSFetchRequestExpressionType = 50
};
Constants
NSFetchRequestExpressionTypeSpecifies the fetch request expression type.
Available in OS X v10.5 and later.
Declared in
NSFetchRequestExpression.h.
Declared In
NSFetchRequestExpression.h© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-03-05)