One Logo Pool Ball
CoreData · IOS API REFERENCE

NSPersistentContainer

class · iOS 10.0+ · SDK 27.1

class NSPersistentContainer

Members (13)

static · iOS 10.0+

defaultDirectoryURL

TypeScript
static defaultDirectoryURL(): string
Swift declaration
class func defaultDirectoryURL() -> URL
init · iOS 10.0+

init

TypeScript
static initName(name: string): NSPersistentContainer
Swift declaration
convenience init(name: String)
init · iOS 10.0+

init

TypeScript
static initNameManagedObjectModel(name: string, model: NSManagedObjectModel): NSPersistentContainer
Swift declaration
init(name: String, managedObjectModel model: NSManagedObjectModel)
method · iOS 10.0+

loadPersistentStores

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

newBackgroundContext

TypeScript
newBackgroundContext(): NSManagedObjectContext
Swift declaration
func newBackgroundContext() -> NSManagedObjectContext
method · iOS 10.0+

performBackgroundTask

TypeScript
performBackgroundTask(block: ((arg0: NSManagedObjectContext) => void)): void
Swift declaration
func performBackgroundTask(_ block: @escaping @Sendable (NSManagedObjectContext) -> Void)
get · iOS 10.0+

managedObjectModel

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

name

TypeScript
get name(): string
Swift declaration
var name: String { get }
get · iOS 10.0+

persistentStoreCoordinator

TypeScript
get persistentStoreCoordinator(): NSPersistentStoreCoordinator
Swift declaration
var persistentStoreCoordinator: NSPersistentStoreCoordinator { get }
get · iOS 10.0+

persistentStoreDescriptions

TypeScript
get persistentStoreDescriptions(): Array<NSPersistentStoreDescription>
Swift declaration
var persistentStoreDescriptions: [NSPersistentStoreDescription] { get set }
set · iOS 10.0+

persistentStoreDescriptions

TypeScript
set persistentStoreDescriptions(value: Array<NSPersistentStoreDescription>)
Swift declaration
var persistentStoreDescriptions: [NSPersistentStoreDescription] { get set }
get · iOS 10.0+

viewContext

TypeScript
get viewContext(): NSManagedObjectContext
Swift declaration
var viewContext: NSManagedObjectContext { get }
get · iOS 15.0+

defaultDirectoryURL

TypeScript
static get defaultDirectoryURL18515(): string
Swift declaration
class var defaultDirectoryURL: URL { get }

Skipped declarations

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

NSPersistentContainer.performBackgroundTask(_:)

synchronous callback requires a nonescaping JS-thread call

NSPersistentContainer.init()

inherited init: cannot prove legal (class declares 2 custom initializers)

All CoreData types →