2016-10-25 1 views
0

私は今、私は同じコードを実行するとはnilを返すのiOS 10にNSPersistentStoreCoordinatorのaddPersistentStoreWithType方法を私のiPad 4を更新した後、私のアプリのためSkypeForBusiness.frameworkを使用していますiOSのと私のiPad 3は、私は最終的に問題SkypeForBusiness.framework addPersistentStoreWithType方法

に修正を見つけ、それが

- (NSPersistentStoreCoordinator *)persistentStoreCoordinator { 

static NSPersistentStoreCoordinator *coordinator = nil; 
static dispatch_once_t token; 
dispatch_once(&token, ^{ 

    // get the model 
    NSManagedObjectModel *model = [NSManagedObjectModel mergedModelFromBundles:nil]; 

    // get the coordinator 
    coordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:model]; 

    // add store 
    NSFileManager *fileManager = [NSFileManager defaultManager]; 
    NSURL *applicationSupportURL = [[fileManager URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask] lastObject]; 
    [fileManager createDirectoryAtURL:applicationSupportURL withIntermediateDirectories:NO attributes:nil error:nil]; 
    NSURL *databaseURL = [applicationSupportURL URLByAppendingPathComponent:@"database_name.sqlite"]; 
    NSError *error = nil; 

    //  [[NSFileManager defaultManager] removeItemAtURL:databaseURL error:&error]; 

    NSDictionary *options = @{ 
           EncryptedStorePassphraseKey : @"********", 
           //   EncryptedStoreDatabaseLocation : databaseURL, 
           NSMigratePersistentStoresAutomaticallyOption : @YES, 
           NSInferMappingModelAutomaticallyOption : @YES 
           }; 
    NSPersistentStore *store = [coordinator 
           addPersistentStoreWithType:EncryptedStoreType 
           configuration:nil 
           URL:databaseURL 
           options:options 
           error:&error]; 
    //  coordinator = [EncryptedStore makeStoreWithOptions:options managedObjectModel:model]; 

    NSAssert(store, @"Unable to add persistent store!\n%@", error); 

}); 
return coordinator; 

}

答えて

0

オブジェクトを返す9.3.5前のXcodeのエラーにi386アーキテクチャXcodeの8

で今

が見つかりません。この

「_sqlite3_key」シンボル(S)のようなものを投げるために使用されるXcodeの6 & 7のように** *アサーションエラー - [AppDelegate persistentStoreCoordinator]、/Users/prosares/Desktop/MyApp/AppAppDelegate.m:198

*** uncによるアプリケーションの終了例外 'NSInternalInconsistencyException'、理由: '永続ストアを追加できません! (null)」の

Xcodeの8は無関係なエラーをスローし、@Appleは、それは非常に迷惑であるバグのこのタイプを解決する必要があり、私はそれを試しを与えると考え、その理由であるXcodeの7でこれを行うために使用されること

を働いたXcodeの8はまた、我々はシミュレータでアプリケーションを実行すると難しい

以下

をデバッグ可能おり、不要なログを出力します私はすでにこの問題

click here

のために答えているリンクです