iOS Developer Library

Developer

CoreData Framework Reference NSPersistentStoreRequest Class Reference

Options
Deployment Target:

On This Page
Language:

NSPersistentStoreRequest

An instance of NSPersistentStoreRequest describes criteria used to retrieve data from or save data to persistent stores.

Inheritance


Conforms To


Import Statement


Swift

import CoreData

Objective-C

@import CoreData;

Availability


Available in iOS 5.0 and later.
  • The stores the request should be sent to.

    Declaration

    Swift

    var affectedStores: [AnyObject]?

    Objective-C

    @property(nonatomic, strong) NSArray *affectedStores

    Discussion

    The array contains instances of NSPersistentStore.

    Import Statement

    Objective-C

    @import CoreData;

    Swift

    import CoreData

    Availability

    Available in iOS 5.0 and later.

  • The type of the fetch request. (read-only)

    Declaration

    Swift

    var requestType: NSPersistentStoreRequestType { get }

    Objective-C

    @property(readonly) NSPersistentStoreRequestType requestType

    Import Statement

    Objective-C

    @import CoreData;

    Swift

    import CoreData

    Availability

    Available in iOS 5.0 and later.

  • These constants specify the types of fetch request.

    Declaration

    Swift

    enum NSPersistentStoreRequestType : UInt { case FetchRequestType case SaveRequestType case BatchUpdateRequestType }

    Objective-C

    enum { NSFetchRequestType = 1, NSSaveRequestType, }; typedef NSUInteger NSPersistentStoreRequestType;

    Constants

    • FetchRequestType

      NSFetchRequestType

      Specifies that the request returns managed objects.

      Available in iOS 5.0 and later.

    • SaveRequestType

      NSSaveRequestType

      Specifies that the request saves managed objects.

      Available in iOS 5.0 and later.

    Discussion

    These constants are used by requestType.

    Import Statement

    Objective-C

    @import CoreData;

    Swift

    import CoreData

    Availability

    Available in iOS 5.0 and later.