Mac Developer Library

Developer

CoreData Framework Reference NSFetchRequestExpression Class Reference

Options
Deployment Target:

On This Page
Language:

NSFetchRequestExpression

Instances of NSFetchRequestExpression represent expressions which evaluate to the result of executing a fetch request on a managed object context. More...

Inheritance


Import Statement


import CoreData @import CoreData;

Availability


Available in OS X v10.5 and later.
  • Returns an expression which will evaluate to the result of executing a fetch request on a context.

    Declaration

    Swift

    class func expressionForFetch(_ fetch: NSExpression, context context: NSExpression, countOnly countFlag: Bool) -> NSExpression

    Objective-C

    + (NSExpression *)expressionForFetch:(NSExpression *)fetch context:(NSExpression *)context countOnly:(BOOL)countFlag

    Parameters

    fetch

    An expression that evaluates to an instance of NSFetchRequest.

    context

    An expression that evaluates to an instance of NSManagedObjectContext.

    countFlag

    If YEStrue, when the new expression is evaluated the managed object context (from context) will perform countForFetchRequest:error: with the fetch request (from fetch). If NOfalse, when the new expression is evaluated the managed object context will perform executeFetchRequest: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).

    Import Statement

    import CoreData

    Availability

    Available in OS X v10.5 and later.

  • The expression for the receiver’s fetch request. (read-only)

    Declaration

    Swift

    var requestExpression: NSExpression { get }

    Objective-C

    @property(readonly, strong) NSExpression *requestExpression

    Discussion

    The expression must evaluate to an NSFetchRequest object.

    Import Statement

    import CoreData

    Availability

    Available in OS X v10.5 and later.

  • The expression for the receiver’s managed object context. (read-only)

    Declaration

    Swift

    var contextExpression: NSExpression { get }

    Objective-C

    @property(readonly, strong) NSExpression *contextExpression

    Discussion

    The expression must evaluate to an NSManagedObjectContext object.

    Import Statement

    import CoreData

    Availability

    Available in OS X v10.5 and later.

  • Returns a Boolean value that indicates whether the receiver represents a count-only fetch request. (read-only)

    Declaration

    Swift

    var countOnlyRequest: Bool { get }

    Objective-C

    @property(getter=isCountOnlyRequest, readonly) BOOL countOnlyRequest

    Discussion

    YEStrue if the receiver represents a count-only fetch request, otherwise NOfalse. If this method returns NOfalse, the managed object context (from the contextExpression) will perform executeFetchRequest:error:: with the requestExpression; if this method returns YEStrue, the managed object context will perform countForFetchRequest:error: with the requestExpression.

    Import Statement

    import CoreData

    Availability

    Available in OS X v10.10 and later.

  • This constant specifies the fetch request expression type.

    Declaration

    Swift

    var NSFetchRequestExpressionType: Int { get }

    Objective-C

    enum { NSFetchRequestExpressionType = 50 };

    Constants

    • NSFetchRequestExpressionType

      NSFetchRequestExpressionType

      Specifies the fetch request expression type.

      Available in OS X v10.5 and later.

    Import Statement