Creating .sqlite file from Core Data store?

前端 未结 2 1143
执笔经年
执笔经年 2021-02-09 11:36

I\'ve seen tutorials in books and on websites that offer .sqlite files for download. The sqlite files are used for Core Data.

How do I get a .sqlite file FROM

2条回答
  •  逝去的感伤
    2021-02-09 11:56

    If you are specifically trying to create a Core Data store, you use this method:

    NSPersistentStoreCoordinator 
        addPersistentStoreWithType:(NSString*)storeType 
        configuration:(NSString*)configuration
        URL:(NSString*)storeURL 
        options:(NSDictionary*)options
        error:(NSError**)error
    

    You must have already associated a NSManagedObjectModel with your persistent store coordinator object. If the store at storeURL does not exist, it will be created; otherwise it will be opened.

提交回复
热议问题