One Logo Pool Ball
CoreData · IOS API REFERENCE

NSPersistentStoreCoordinator

class · iOS 3.0+ · SDK 27.1

class NSPersistentStoreCoordinator

Members (43)

static · iOS 26.4+

cachedModelForPersistentStore

TypeScript
static cachedModelForPersistentStore(url: string, options?: (NativeMap<unknown, unknown>) | null): NSManagedObjectModel
Swift declaration
class func cachedModelForPersistentStore(at url: URL, options: [AnyHashable : Any]? = nil) throws -> NSManagedObjectModel
static · iOS 3.0+ · Deprecated in iOS 9.0

metadataForPersistentStore

TypeScript
static metadataForPersistentStoreOfTypeAt(storeType: (string) | null, url: string): Record<string, unknown>
Swift declaration
class func metadataForPersistentStore(ofType storeType: String?, at url: URL) throws -> [String : Any]
static · iOS 7.0+

metadataForPersistentStore

TypeScript
static metadataForPersistentStoreOfTypeAtOptions(storeType: string, url: string, options?: (NativeMap<unknown, unknown>) | null): Record<string, unknown>
Swift declaration
class func metadataForPersistentStore(ofType storeType: String, at url: URL, options: [AnyHashable : Any]? = nil) throws -> [String : Any]
static · iOS 3.0+

registerStoreClass

TypeScript
static registerStoreClassForStoreType(storeClass: (string) | null, storeType: string): void
Swift declaration
class func registerStoreClass(_ storeClass: AnyClass?, forStoreType storeType: String)
static · iOS 5.0+ · Deprecated in iOS 10.0

removeUbiquitousContentAndPersistentStore

TypeScript
static removeUbiquitousContentAndPersistentStore(storeURL: string, options?: (NativeMap<unknown, unknown>) | null): void
Swift declaration
class func removeUbiquitousContentAndPersistentStore(at storeURL: URL, options: [AnyHashable : Any]? = nil) throws
static · iOS 3.0+ · Deprecated in iOS 9.0

setMetadata

TypeScript
static setMetadataForPersistentStoreOfTypeAt(metadata: (Record<string, unknown>) | null, storeType: (string) | null, url: string): void
Swift declaration
class func setMetadata(_ metadata: [String : Any]?, forPersistentStoreOfType storeType: String?, at url: URL) throws
static · iOS 7.0+

setMetadata

TypeScript
static setMetadataForPersistentStoreOfTypeAtOptions(metadata: (Record<string, unknown>) | null, storeType: string, url: string, options?: (NativeMap<unknown, unknown>) | null): void
Swift declaration
class func setMetadata(_ metadata: [String : Any]?, forPersistentStoreOfType storeType: String, at url: URL, options: [AnyHashable : Any]? = nil) throws
get · iOS 3.0+

registeredStoreTypes

TypeScript
static get registeredStoreTypes(): Record<string, _Foundation_NSValue>
Swift declaration
class var registeredStoreTypes: [String : NSValue] { get }
method · iOS 3.0+

url

TypeScript
url(store: NSPersistentStore): string
Swift declaration
func url(for store: NSPersistentStore) -> URL
method · iOS 10.0+

addPersistentStore

TypeScript
addPersistentStoreWithCompletionHandler(storeDescription: NSPersistentStoreDescription, block: ((arg0: NSPersistentStoreDescription, arg1: (NativeError) | null) => void)): void
Swift declaration
func addPersistentStore(with storeDescription: NSPersistentStoreDescription, completionHandler block: @escaping (NSPersistentStoreDescription, (any Error)?) -> Void)
method · iOS 3.0+

addPersistentStore

TypeScript
addPersistentStoreOfTypeConfigurationNameAtOptions(storeType: string, configuration?: (string) | null, storeURL?: (string) | null, options?: (NativeMap<unknown, unknown>) | null): NSPersistentStore
Swift declaration
func addPersistentStore(ofType storeType: String, configurationName configuration: String?, at storeURL: URL?, options: [AnyHashable : Any]? = nil) throws -> NSPersistentStore
method · iOS 12.0+

currentPersistentHistoryToken

TypeScript
currentPersistentHistoryToken(stores?: (Array<unknown>) | null): (NSPersistentHistoryToken) | null
Swift declaration
func currentPersistentHistoryToken(fromStores stores: [Any]?) -> NSPersistentHistoryToken?
method · iOS 9.0+

destroyPersistentStore

TypeScript
destroyPersistentStoreAtOfTypeOptions(url: string, storeType: string, options?: (NativeMap<unknown, unknown>) | null): void
Swift declaration
func destroyPersistentStore(at url: URL, ofType storeType: String, options: [AnyHashable : Any]? = nil) throws
method · iOS 5.0+

execute

TypeScript
execute(request: NSPersistentStoreRequest, context: NSManagedObjectContext): unknown
Swift declaration
func execute(_ request: NSPersistentStoreRequest, with context: NSManagedObjectContext) throws -> Any
method · iOS 14.0+

finishDeferredLightweightMigration

TypeScript
finishDeferredLightweightMigration(): void
Swift declaration
func finishDeferredLightweightMigration() throws
method · iOS 14.0+

finishDeferredLightweightMigrationTask

TypeScript
finishDeferredLightweightMigrationTask(): void
Swift declaration
func finishDeferredLightweightMigrationTask() throws
init · iOS 3.0+

init

TypeScript
static init(model: NSManagedObjectModel): NSPersistentStoreCoordinator
Swift declaration
init(managedObjectModel model: NSManagedObjectModel)
method · iOS 3.0+ · Deprecated in iOS 8.0

lock

TypeScript
lock(): void
Swift declaration
func lock()
method · iOS 3.0+

managedObjectID

TypeScript
managedObjectIDForURIRepresentation(url: string): (NSManagedObjectID) | null
Swift declaration
func managedObjectID(forURIRepresentation url: URL) -> NSManagedObjectID?
method · iOS 3.0+

metadata

TypeScript
metadata(store: NSPersistentStore): Record<string, unknown>
Swift declaration
func metadata(for store: NSPersistentStore) -> [String : Any]
method · iOS 3.0+

migratePersistentStore

TypeScript
migratePersistentStoreToOptionsWithType(store: NSPersistentStore, URL: string, options: (NativeMap<unknown, unknown>) | null, storeType: string): NSPersistentStore
Swift declaration
func migratePersistentStore(_ store: NSPersistentStore, to URL: URL, options: [AnyHashable : Any]? = nil, withType storeType: String) throws -> NSPersistentStore
method · iOS 8.0+

perform

TypeScript
perform(block: (() => void)): void
Swift declaration
func perform(_ block: @escaping @Sendable () -> Void)
method · iOS 8.0+

performAndWait

TypeScript
performAndWait(block: (() => void)): void
Swift declaration
func performAndWait(_ block: @Sendable () -> Void)
method · iOS 3.0+

persistentStore

TypeScript
persistentStore(URL: string): (NSPersistentStore) | null
Swift declaration
func persistentStore(for URL: URL) -> NSPersistentStore?
method · iOS 3.0+

remove

TypeScript
remove(store: NSPersistentStore): void
Swift declaration
func remove(_ store: NSPersistentStore) throws
method · iOS 9.0+

replacePersistentStore

TypeScript
replacePersistentStoreAtDestinationOptionsWithPersistentStoreFromSourceOptionsOfType(destinationURL: string, destinationOptions: (NativeMap<unknown, unknown>) | null, sourceURL: string, sourceOptions: (NativeMap<unknown, unknown>) | null, storeType: string): void
Swift declaration
func replacePersistentStore(at destinationURL: URL, destinationOptions: [AnyHashable : Any]? = nil, withPersistentStoreFrom sourceURL: URL, sourceOptions: [AnyHashable : Any]? = nil, ofType storeType: String) throws
method · iOS 3.0+

setMetadata

TypeScript
setMetadataFor(metadata: (Record<string, unknown>) | null, store: NSPersistentStore): void
Swift declaration
func setMetadata(_ metadata: [String : Any]?, for store: NSPersistentStore)
method · iOS 3.0+

setURL

TypeScript
setURL(url: string, store: NSPersistentStore): boolean
Swift declaration
func setURL(_ url: URL, for store: NSPersistentStore) -> Bool
method · iOS 3.0+ · Deprecated in iOS 8.0

tryLock

TypeScript
tryLock(): boolean
Swift declaration
func tryLock() -> Bool
method · iOS 3.0+ · Deprecated in iOS 8.0

unlock

TypeScript
unlock(): void
Swift declaration
func unlock()
get · iOS 3.0+

managedObjectModel

TypeScript
get managedObjectModel(): NSManagedObjectModel
Swift declaration
var managedObjectModel: NSManagedObjectModel { get }
get · iOS 8.0+

name

TypeScript
get name(): (string) | null
Swift declaration
var name: String? { get set }
set · iOS 8.0+

name

TypeScript
set name(value: (string) | null)
Swift declaration
var name: String? { get set }
get · iOS 3.0+

persistentStores

TypeScript
get persistentStores(): Array<NSPersistentStore>
Swift declaration
var persistentStores: [NSPersistentStore] { get }
method · iOS 15.0+

addPersistentStore

TypeScript
addPersistentStoreTypeConfigurationAtOptions(type: NSPersistentStore_StoreType, configuration: (string) | null, storeURL: string, options?: (NativeMap<unknown, unknown>) | null): NSPersistentStore
Swift declaration
func addPersistentStore(type: NSPersistentStore.StoreType, configuration: String? = nil, at storeURL: URL, options: [AnyHashable : Any]? = nil) throws -> NSPersistentStore
method · iOS 15.0+

destroyPersistentStore

TypeScript
destroyPersistentStoreAtTypeOptions(url: string, storeType: NSPersistentStore_StoreType, options?: (NativeMap<unknown, unknown>) | null): void
Swift declaration
func destroyPersistentStore(at url: URL, type storeType: NSPersistentStore.StoreType, options: [AnyHashable : Any]? = nil) throws
method · iOS 15.0+

migratePersistentStore

TypeScript
migratePersistentStoreToOptionsType(store: NSPersistentStore, storeURL: string, options: (NativeMap<unknown, unknown>) | null, storeType: NSPersistentStore_StoreType): NSPersistentStore
Swift declaration
func migratePersistentStore(_ store: NSPersistentStore, to storeURL: URL, options: [AnyHashable : Any]? = nil, type storeType: NSPersistentStore.StoreType) throws -> NSPersistentStore
method · iOS 15.0+

replacePersistentStore

TypeScript
replacePersistentStoreAtDestinationOptionsWithPersistentStoreFromSourceOptionsType(destinationURL: string, destinationOptions: (NativeMap<unknown, unknown>) | null, sourceURL: string, sourceOptions: (NativeMap<unknown, unknown>) | null, sourceType: NSPersistentStore_StoreType): void
Swift declaration
func replacePersistentStore(at destinationURL: URL, destinationOptions: [AnyHashable : Any]? = nil, withPersistentStoreFrom sourceURL: URL, sourceOptions: [AnyHashable : Any]? = nil, type sourceType: NSPersistentStore.StoreType) throws
static · iOS 15.0+

metadataForPersistentStore

TypeScript
static metadataForPersistentStoreTypeAtOptions(storeType: NSPersistentStore_StoreType, storeURL: string, options?: (NativeMap<unknown, unknown>) | null): Record<string, unknown>
Swift declaration
class func metadataForPersistentStore(type storeType: NSPersistentStore.StoreType, at storeURL: URL, options: [AnyHashable : Any]? = nil) throws -> [String : Any]
static · iOS 15.0+

registerStoreClass

TypeScript
static registerStoreClassType(storeClass: (string) | null, type: NSPersistentStore_StoreType): void
Swift declaration
class func registerStoreClass(_ storeClass: AnyClass?, type: NSPersistentStore.StoreType)
static · iOS 15.0+

setMetadata

TypeScript
static setMetadataTypeAtOptions(metadata: (Record<string, unknown>) | null, storeType: NSPersistentStore_StoreType, storeURL: string, options?: (NativeMap<unknown, unknown>) | null): void
Swift declaration
class func setMetadata(_ metadata: [String : Any]?, type storeType: NSPersistentStore.StoreType, at storeURL: URL, options: [AnyHashable : Any]? = nil) throws
method · iOS 15.0+

performAndWait

TypeScript
performAndWait483(block: (() => unknown)): unknown
Swift declaration
@preconcurrency func performAndWait<T>(_ block: @Sendable () throws -> T) rethrows -> T
method · iOS 18.0+

managedObjectID

TypeScript
managedObjectIDFor(string: string): (NSManagedObjectID) | null
Swift declaration
func managedObjectID(for string: String) -> NSManagedObjectID?

Skipped declarations

2 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

NSPersistentStoreCoordinator.perform(_:)

synchronous callback requires a nonescaping JS-thread call

NSPersistentStoreCoordinator.init()

inherited init: cannot prove legal (class declares 1 custom initializer)

All CoreData types →