스토어를 여는 데 사용된 모델이 스토어를 만드는 데 사용된 모델과 호환되지 않습니다.
xcode 3.2에서 코어 데이터 모델을 생성하고 Xcode 4.2에서 업그레이드한 후 NSManagedObject 하위 클래스의 새 엔티티를 추가했습니다(새 엔티티 참조).
우선 예전 것과 같은 그룹이 아니라서 이상해 보입니다.여기 제 xcode 4.2(알키타브)에 있는 사진입니다.DB는 xcode 3.2에서 만든 것이고 EndDB는 현재 xcode 버전(4.2)에서 새로 만든 것입니다.

두 번째는 그대로 두었다가 첫 번째 엔티티(구 엔티티)와 동일한 방식으로 두 번째 엔티티(새 엔티티)에 액세스하면 제목과 같은 오류가 나타납니다.
다음은 오류입니다.
2012-01-16 21:13:38.496 iHuria[55953:207] Unresolved error Error Domain=NSCocoaErrorDomain Code=134100 "The operation couldn’t be completed. (Cocoa error 134100.)" UserInfo=0x8829cd0 {metadata=<CFBasicHash 0x882a370 [0x1839b38]>{type = immutable dict, count = 7,
entries =>
2 : <CFString 0x8829b90 [0x1839b38]>{contents = "NSStoreModelVersionIdentifiers"} = <CFArray 0x8829ff0 [0x1839b38]>{type = immutable, count = 0, values = ()}
4 : <CFString 0x8829bc0 [0x1839b38]>{contents = "NSPersistenceFrameworkVersion"} = <CFNumber 0x8829770 [0x1839b38]>{value = +320, type = kCFNumberSInt64Type}
6 : <CFString 0x8829bf0 [0x1839b38]>{contents = "NSStoreModelVersionHashes"} = <CFBasicHash 0x882a080 [0x1839b38]>{type = immutable dict, count = 1,
entries =>
0 : <CFString 0x882a010 [0x1839b38]>{contents = "AlkitabDB"} = <CFData 0x882a030 [0x1839b38]>{length = 32, capacity = 32, bytes = 0xd02ac5f8be6ab0b39add450aca202ac0 ... 3d45d462998d2ccd}
}
7 : <CFString 0x10e3aa8 [0x1839b38]>{contents = "NSStoreUUID"} = <CFString 0x8829e60 [0x1839b38]>{contents = "4F2EE7FF-463B-4055-BBED-8E603CDBDF59"}
8 : <CFString 0x10e3948 [0x1839b38]>{contents = "NSStoreType"} = <CFString 0x10e3958 [0x1839b38]>{contents = "SQLite"}
9 : <CFString 0x8829c40 [0x1839b38]>{contents = "NSStoreModelVersionHashesVersion"} = <CFNumber 0x6b1c7c0 [0x1839b38]>{value = +3, type = kCFNumberSInt32Type}
10 : <CFString 0x8829c70 [0x1839b38]>{contents = "_NSAutoVacuumLevel"} = <CFString 0x882a0c0 [0x1839b38]>{contents = "2"}
}
, reason=The model used to open the store is incompatible with the one used to create the store}, {
metadata = {
NSPersistenceFrameworkVersion = 320;
NSStoreModelVersionHashes = {
AlkitabDB = <d02ac5f8 be6ab0b3 9add450a ca202ac0 ebd1e860 cbb578c2 3d45d462 998d2ccd>;
};
NSStoreModelVersionHashesVersion = 3;
NSStoreModelVersionIdentifiers = (
);
NSStoreType = SQLite;
NSStoreUUID = "4F2EE7FF-463B-4055-BBED-8E603CDBDF59";
"_NSAutoVacuumLevel" = 2;
};
reason = "The model used to open the store is incompatible with the one used to create the store";
}
전에 해결책을 찾아봤는데 시뮬레이터에서 앱을 제거하고 다시 실행해야 한다는 것을 발견했는데 작동하지 않았습니다.이 문제에 대한 해결책을 아는 사람이 있습니까?제발 도와주세요.
앱을 삭제하는 것은 경우에 따라 다릅니다!제안합니다. 앱이 이미 게시되었습니다!새 엔터티를 데이터베이스에 추가하고 계속할 수는 없습니다. 마이그레이션을 수행해야 합니다.
설명서를 파고들지 않고 빠른 해결책을 찾고 있는 사용자를 위해:
- .xcdatamodeld 파일 열기
- 편집기 클릭
- 모델 버전 추가...를 선택합니다.
- 모델의 새 버전 추가(새 데이터 모델 그룹 추가)
- 기본 파일 선택, 파일 검사기 열기(오른쪽 패널)
- 하이 아래.
Versioned core data model데이터 새 버전 하십시오. 데이터 모델은 다음과 같습니다. - 이것이 전부가 아닙니다.) 소위 "가벼운 마이그레이션"을 수행해야 합니다.
- 으로
AppDelegate그리고 어디에 있는지 찾아보세요.persistentStoreCoordinator입니다. - 줄 이 줄 »
if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) - 를 바꿉니다.
nil이 있는 옵션@{NSMigratePersistentStoresAutomaticallyOption:@YES, NSInferMappingModelAutomaticallyOption:@YES}그이 달린 ( - 자, 재미있게 놀아요!
추신: 이는 경량 마이그레이션에만 적용됩니다.마이그레이션이 경량 마이그레이션으로 적합하려면 변경 사항이 다음과 같은 좁은 범위로 제한되어야 합니다.
- 속성(속성 또는 관계)을 추가하거나 제거합니다.
- 선택 사항이 아닌 속성을 선택 사항으로 지정합니다.
- 기본값을 제공하는 한 선택적 특성을 선택적이지 않게 만듭니다.
- 엔티티를 추가하거나 제거합니다.
- 속성 이름을 변경합니다.
- 엔티티 이름을 바꿉니다.
스위프트 4용
coordinator.addPersistentStore(ofType: NSSQLiteStoreType, configurationName: nil, at: url, options: [NSMigratePersistentStoresAutomaticallyOption: true, NSInferMappingModelAutomaticallyOption: true])
시뮬레이터에서 앱을 제거하고 프로젝트를 정리합니다.그것은 그 문제들을 해결할 것입니다.앱을 삭제할 때 디버거에서 실행되고 있지 않은지 확인하십시오. 그렇지 않으면 실제로 제대로 삭제되지 않습니다.
사라졌는지 , 이 를 확인하세요.Users/INSERT_YOUR_USER_HERE/Library/Application Support/iPhone Simulator/실행 중인 버전 아래에 있는 앱의 폴더입니다.
참고: 이는 개발 전용입니다.프로덕션의 경우 일종의 마이그레이션을 구현해야 합니다.Google "핵심 데이터 마이그레이션", 경량 마이그레이션이 가장 간단합니다.
아래와 같이 핵심 데이터 메서드에 대해 AppDelegate.m 파일에 영구 StoreCoordinator를 생성하는 동안 Options 속성을 추가하기만 하면 됩니다.
목표-C
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator
{
if (_persistentStoreCoordinator != nil)
{
return _persistentStoreCoordinator;
}
NSLog(@"persistentStoreCoordinator___");
NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"MyApp.sqlite"];
NSMutableDictionary *options = [[NSMutableDictionary alloc] init];
[options setObject:[NSNumber numberWithBool:YES] forKey:NSMigratePersistentStoresAutomaticallyOption];
[options setObject:[NSNumber numberWithBool:YES] forKey:NSInferMappingModelAutomaticallyOption];
NSError *error = nil;
_persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];
if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:options error:&error])
{
NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
abort();
}
NSLog(@"persistentStoreCoordinator___2");
return _persistentStoreCoordinator;
}
스위프트
lazy var persistentStoreCoordinator: NSPersistentStoreCoordinator = {
// The persistent store coordinator for the application. This implementation creates and returns a coordinator, having added the store for the application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail.
// Create the coordinator and store
let coordinator = NSPersistentStoreCoordinator(managedObjectModel: self.managedObjectModel)
let url = self.applicationDocumentsDirectory.URLByAppendingPathComponent("SingleViewCoreData.sqlite")
var failureReason = "There was an error creating or loading the application's saved data."
// MAIN LINE OF CODE TO ADD
let mOptions = [NSMigratePersistentStoresAutomaticallyOption: true,
NSInferMappingModelAutomaticallyOption: true]
do {
try coordinator.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: url, options: mOptions)
} catch {
// Report any error we got.
var dict = [String: AnyObject]()
dict[NSLocalizedDescriptionKey] = "Failed to initialize the application's saved data"
dict[NSLocalizedFailureReasonErrorKey] = failureReason
dict[NSUnderlyingErrorKey] = error as NSError
let wrappedError = NSError(domain: "YOUR_ERROR_DOMAIN", code: 9999, userInfo: dict)
// Replace this with code to handle the error appropriately.
// abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
NSLog("Unresolved error \(wrappedError), \(wrappedError.userInfo)")
abort()
}
return coordinator
}
그것은 나의 문제를 해결했습니다.
답변: 시뮬레이터에서 앱을 제거하고 프로젝트를 정리한 후 다시 빌드합니다.
참고: Core Data 정의를 변경할 때마다 Physical Device 또는 Simulator에 설치된 앱을 삭제하고 프로젝트를 정리한 후 다시 빌드합니다.
예. 물리적 장치에서 앱을 삭제하고 다시 빌드하면 작동합니다.
swift의 경우 AppDelegate.swift에서 라인을 찾습니다.
try coordinator!.addPersistentStoreWithType(NSXMLStoreType, configuration: nil, URL: url, options: nil )
그리고 그것을 대체합니다.
try coordinator!.addPersistentStoreWithType(NSXMLStoreType, configuration: nil, URL: url, options: [NSMigratePersistentStoresAutomaticallyOption: true, NSInferMappingModelAutomaticallyOption: true])
저는 며칠 동안 이 오류와 함께 병합된 ModelFromBundle 충돌과 "*라는 이름의 두 개의 다른 엔티티와 모델을 병합할 수 없습니다" 오류와 싸웠습니다.
근본적인 문제는 Xcode가 장치에서 오래된 리소스를 제거하지 않고 충돌을 일으키는 이전 버전의 데이터 모델(.mom 파일)이 있다는 것입니다.이것이 앱을 삭제하는 것이 제 장치 중 하나에서 문제를 해결한 이유입니다.
다른 SO 응답을 통해 이 블로그 게시물을 찾은 후 모든 .mom 파일을 찾는 이 행을 변경하여 앱이 이전 모델에 대해 더 내성을 갖도록 했습니다.
NSManagedObjectModel *model = [NSManagedObjectModel mergedModelFromBundles:nil];
필터 디렉토리에서만 검색되는 다음 항목에 대해 설명합니다.
NSString *path = [[NSBundle mainBundle] pathForResource:@"Filters" ofType:@"momd"];
NSURL *momURL = [NSURL fileURLWithPath:path];
NSManagedObjectModel *model = [[NSManagedObjectModel alloc] initWithContentsOfURL:momURL];
앱에 있는 모든 .mom 파일을 기록하여 이 문제를 해결하는 데 도움을 주기 위해 다음과 같은 질문에서 recursivePathsForResourcesOfType을 사용했습니다.
NSArray *momPaths = [self recursivePathsForResourcesOfType:@"mom" inDirectory:[[NSBundle mainBundle] resourcePath]];
NSLog(@"All .mom files:%@",momPaths);
저는 또한 아이익스플로러를 사용하여 외부 .mom 파일을 보았습니다(아직 삭제하지 않았습니다).
아래 방법도 도움이 되었습니다.[pscmanagedObjectModel]이(가) 반환한 병합된 모델에 엔티티가 있음을 보여주었는데, 이 모델은 내 모델이나 스토어 자체에 더 이상 존재하지 않습니다.이것이 바로 오래된 모델이 깨끗한 건물에서 제거되지 않은 장치 자체에 캐시되어 있다는 것을 믿을 수 있게 해주었습니다.메소드는 모델과 동일하거나, 변경되었거나, 모델에 추가되거나, 모델에서 제거된 각 엔터티를 기록합니다.(이 SO 답변을 시작점으로 작성):
- (BOOL)comparePersistentStore:(NSPersistentStoreCoordinator *)psc withStoreURL: (NSURL *)storeURL {
NSError *error = nil;
// Get the entities & keys from the persistent store coordinator
NSManagedObjectModel *pscModel = [psc managedObjectModel];
NSDictionary *pscEntities = [pscModel entitiesByName];
NSSet *pscKeys = [NSSet setWithArray:[pscEntities allKeys]];
//NSLog(@"psc model:%@", pscModel);
//NSLog(@"psc keys:%@", pscKeys);
NSLog(@"psc contains %d entities", [pscModel.entities count]);
// Get the entity hashes from the storeURL
NSDictionary *storeMetadata = [NSPersistentStoreCoordinator metadataForPersistentStoreOfType:NSSQLiteStoreType
URL:storeURL
error:&error];
NSDictionary *storeHashes = [storeMetadata objectForKey:@"NSStoreModelVersionHashes"];
//NSLog(@"store metadata:%@", sourceMetadata);
NSLog(@"store URL:%@", storeURL);
NSLog(@"store NSStoreUUID:%@", [storeMetadata objectForKey:@"NSStoreUUID"]);
NSLog(@"store NSStoreType:%@", [storeMetadata objectForKey:@"NSStoreType"]);
NSSet *storeKeys = [NSSet setWithArray:[storeHashes allKeys]];
// Determine store entities that were added, removed, and in common (to/with psc)
NSMutableSet *addedEntities = [NSMutableSet setWithSet:pscKeys];
NSMutableSet *removedEntities = [NSMutableSet setWithSet:storeKeys];
NSMutableSet *commonEntities = [NSMutableSet setWithSet:pscKeys];
NSMutableSet *changedEntities = [NSMutableSet new];
[addedEntities minusSet:storeKeys];
[removedEntities minusSet:pscKeys];
[commonEntities minusSet:removedEntities];
[commonEntities minusSet:addedEntities];
// Determine entities that have changed (with different hashes)
[commonEntities enumerateObjectsUsingBlock:^(NSString *key, BOOL *stop) {
NSData *storeHash = [storeHashes objectForKey:key];
NSEntityDescription *pscDescrip = [pscEntities objectForKey:key];
if ( ! [pscDescrip.versionHash isEqualToData:storeHash]) {
if (storeHash != nil && pscDescrip.versionHash != nil) {
[changedEntities addObject:key];
}
}
}];
// Remove changed entities from common list
[commonEntities minusSet:changedEntities];
if ([commonEntities count] > 0) {
NSLog(@"Common entities:");
[commonEntities enumerateObjectsUsingBlock:^(NSString *key, BOOL *stop) {
NSData *storeHash = [storeHashes objectForKey:key];
NSEntityDescription *pscDescrip = [pscEntities objectForKey:key];
NSLog(@"\t%@:\t%@", key, pscDescrip.versionHash);
}];
}
if ([changedEntities count] > 0) {
NSLog(@"Changed entities:");
[changedEntities enumerateObjectsUsingBlock:^(NSString *key, BOOL *stop) {
NSData *storeHash = [storeHashes objectForKey:key];
NSEntityDescription *pscDescrip = [pscEntities objectForKey:key];
NSLog(@"\tpsc %@:\t%@", key, pscDescrip.versionHash);
NSLog(@"\tstore %@:\t%@", key, storeHash);
}];
}
if ([addedEntities count] > 0) {
NSLog(@"Added entities to psc model (not in store):");
[addedEntities enumerateObjectsUsingBlock:^(NSString *key, BOOL *stop) {
NSEntityDescription *pscDescrip = [pscEntities objectForKey:key];
NSLog(@"\t%@:\t%@", key, pscDescrip.versionHash);
}];
}
if ([removedEntities count] > 0) {
NSLog(@"Removed entities from psc model (exist in store):");
[removedEntities enumerateObjectsUsingBlock:^(NSString *key, BOOL *stop) {
NSData *storeHash = [storeHashes objectForKey:key];
NSLog(@"\t%@:\t%@", key, storeHash);
}];
}
BOOL pscCompatibile = [pscModel isConfiguration:nil compatibleWithStoreMetadata:storeMetadata];
NSLog(@"Migration needed? %@", pscCompatibile?@"no":@"yes");
return pscCompatibile;
}
사용량: NSPersistentStoreCoordinator에 각 스토어를 추가하기 전에 호출됩니다.
[self comparePersistentStore:self.psc withStoreURL:self.iCloudStoreURL];
_iCloudStore = [self.psc addPersistentStoreWithType:NSSQLiteStoreType
configuration:nil
URL:self.iCloudStoreURL
options:options
error:&localError];
핵심 날짜 정의를 변경할 때마다 물리적 장치 또는 시뮬레이터에 설치된 앱을 삭제해야 합니다.
- 앱 실행을 중지합니다.
- 시뮬레이터에서 앱을 삭제합니다.
Product- >Clean- 빌드, 런.
Swift 2.1, Xcode 7에서 작동한 가장 간단한 솔루션은 다음과 같습니다.
Simulator에서 앱을 삭제합니다(Cmd + Shift + H). 홈 화면으로 이동합니다.길게 앱을 누르고, 십자 기호를 누르십시오. 휴대폰에서 앱을 삭제하는 일반적인 방법입니다.)
Cmd + Shift + H를 다시 실행하여 앱의 댄싱을 클릭합니다.
프로젝트로 돌아가서 다시 실행
2개의 엔티티가 설정된 Core Data에서 쓰기/읽기를 하는 동안 이 문제가 발생했습니다.앱을 삭제하고 프로그램을 다시 실행하여 문제를 해결했습니다.
ㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠ 지웠어요.[Simulator App Folder]/Document/*.sqlite엔티티를 변경한 후 파일이 작동했습니다.그리고 물론 .sqlite 파일에는 손실될 모든 저장된 데이터와 구조가 포함되어 있습니다.
시뮬레이터에서 응용 프로그램을 삭제하고 코드를 정리하여 실행하십시오. 잘 작동합니다. 당신에게 도움이 될 수 있습니다.
Swift를 사용하는 경우.
@Stas의 답변에 따라 앱 대리자에 0 대신 옵션을 삽입합니다.
let myOptions = [NSMigratePersistentStoresAutomaticallyOption: true,
NSInferMappingModelAutomaticallyOption: true]
if coordinator!.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: url, options: myOptions, error: &error) == nil {
시뮬레이터에서 "콘텐츠 & 설정 재설정"을 시도합니다.앱 삭제 및 Clean build 후 나를 위해 작업했습니다.
제 앱에서도 같은 문제가 발생했습니다(아직 앱스토어에 출시되지 않았습니다).
다음과 같이 수정했습니다.
- 청소 실행(cmd+Shift+K)
- iOS 시뮬레이터 다시 시작
- iOS Simulator -> 콘텐츠 및 설정 재설정(navbar에서)
마침내 제대로 작동하게 된 단계입니다.이것이 도움이 되길 바랍니다!
저의 경우, 2개의 영구 저장소, 사용자별 데이터를 위한 로컬 저장소 및 iCloud와 자동으로 동기화되는 공통 데이터를 위한 CoreData+CloudKit 저장소가 있었습니다.따라서 데이터 모델에는 두 가지 구성이 있으며 필요에 따라 엔티티가 두 구성 모두에 할당됩니다.
개발 중 버그로 인해 더 이상 어떤 구성에도 할당되지 않은 엔티티를 저장하려고 했습니다.따라서 컨텍스트가 저장되었을 때 CoreData는 비호환성을 인식하고 이 오류와 함께 충돌했습니다.
물론 이런 경우 앱을 삭제하는 것은 도움이 되지 않습니다.할당된 엔티티만 영구 저장소에 저장되도록 해야 합니다.
관리 개체 모델에서 스키마를 변경할 때 장치에서 앱을 제거할 수 있는 경우도 있지만, 일부 시나리오에서는 이전 스키마를 사용하여 앱을 이미 게시했기 때문에 이 작업이 불가능합니다.
이 경우 이전 데이터를 새 스키마로 마이그레이션해야 합니다.
마이그레이션을 사용하여 핵심 데이터 모델을 마이그레이션해야 합니다.모델을 변경할 때마다 버전 관리 없이 호환되지 않게 됩니다.긴장하세요, 그건 좀 까다로운 주제입니다.
코어 데이터 모델을 변경하는 경우 사용자가 현재 릴리스된 버전으로 생성한 기존 지속 개체를 새 모델로 채택하는 방법을 코어 데이터에 알려주는 마이그레이션 정책을 제공해야 합니다.
일부 시나리오에서는 코어 데이터가 이전 모델에서 새 모델로의 매핑을 자동으로 추론할 수 있습니다.보다 복잡한 변경 작업을 수행하려면 마이그레이션을 수행하는 일부 논리를 구현해야 할 수 있습니다.
자세한 내용은 핵심 데이터 모델 버전 및 데이터 마이그레이션 프로그래밍 가이드에서 확인할 수 있습니다.
스택 오버플로에 대한 이 답변은 코어 데이터의 경량 마이그레이션의 기본 사항을 다루며 시작하기 위한 몇 가지 코드도 제공합니다.
첫째, 유일하게 있어야 할 것은xcdatamodeld은 묶은입니다.xcdatamodel파일입니다. 하위 클래스가 다음에 있으면 안 됩니다.xcdatamodeld저것들을 거기서 치워요.그들이 컴파일러를 혼란스럽게 할 가능성이 꽤 있습니다.
둘째, 이 오류는 코어 데이터가 모형을 찾을 수 없음을 나타냅니다.데이터를 생성한 다음 모델을 터치했습니까?만약 그렇다면 당신은 일관성이 없는 상태에 있으며 (Philippe가 제안한) 데이터를 삭제하거나 모델의 변경 사항을 롤백하여 수정해야 합니다.
이 문제는 일반적으로 DB가 작성된 버전 간의 비호환성으로 인해 발생합니다.이 문제에 대한 일반적인 접근 방식은 앱을 삭제하고 다시 설치하는 것입니다.그러나 당신이 언급한 경우, Xcode 3.2와 4.2에서는 DB의 버전이 완전히 다릅니다.따라서 동일한 버전의 Xcode를 DB에 사용하는 것이 좋습니다.
오류가 발생했는데 오류가 발생한 이유는 다음과 같습니다.
원래 "Entry"라는 하나의 엔터티가 있었고 데이터베이스에 해당 엔터티에 대해 하나의 행이 저장되었습니다.그런 다음 "Person"이라는 이름의 다른 엔티티를 추가했는데, 추가한 후 빌드로 이동하여 오류가 발생했습니다.그래서 저는 "사람" 엔터티를 삭제하고 앱을 구축하여 문제를 해결하고 "엔트리"에 있던 행을 삭제한 다음 앱을 닫았습니다.그런 다음 휴대폰에서 앱을 완전히 삭제한 다음 다시 빌드를 수행하여 정상적으로 작동했습니다.어느 단계에서 문제를 해결했는지는 확실하지 않지만(행 또는 앱 삭제), 해결책을 찾고 있다면 도움이 될 것입니다. :)
편집: 아, 그리고 앱을 다시 빌드하기 위해 새 엔터티(나의 경우 "사용자")를 삭제하는 것이 걱정된다면 CMD+Z를 사용하여 나중에 다시 가져올 수 있다는 것을 기억하십시오!
이 문제가 있었습니다. 먼저 시뮬레이터를 재설정한 다음 프로젝트를 정리하고 다시 빌드했습니다.그리고는 효과가 있습니다.
핵심 데이터를 변경할 때(테이블에 필드 추가, 필드 제거 등) 응용프로그램 문서 폴더의 sqlite 파일이 스키마와 동기화되어야 합니다.
이 파일은 기본적으로 덮어쓰지 않으므로 다시 생성해야 합니다.
다음 단계를 수행합니다.
NSURL이 가리키는 폴더로 이동합니다. (이 경로는 충돌하기 전에 응용 프로그램에서 생성한 예외 메시지에서 찾을 수 있습니다.) 예: /Users//Library/Application Support/iPhone Simulator/Applications/Documents
sqlite 파일 제거 또는 이름 바꾸기
- 응용 프로그램 치료 및 다시 실행
- 응용 프로그램을 다시 실행하면 새 sqlite 파일이 생성됩니다.
이렇게 하면 스키마와 X 코드가 동기화됩니다.
이것은 일부 사람들에게 도움이 될 수 있지만 질문에 답하지 않을 수 있습니다.저의 경우 모델을 올바른 구성에 추가하는 것을 잊어버려서 문제가 해결되었습니다.첨부된 스크린샷을 참조하십시오.모든 모델이 기본 구성에 추가되지만 내 응용 프로그램은 개인 구성을 사용합니다.모델을 기본 구성에서 올바른 구성으로 드래그 앤 드롭합니다.
iOS 시뮬레이터 -> 콘텐츠 및 설정 재설정...
나를 위해 일했습니다.
iOS 시뮬레이터 -> 콘텐츠 및 설정 재설정...-> iOS9(xcode 7.1)에서도 Reset이 작동합니다.
언급URL : https://stackoverflow.com/questions/8881453/the-model-used-to-open-the-store-is-incompatible-with-the-one-used-to-create-the
'programing' 카테고리의 다른 글
| 일치하는 줄 뒤에서 시작하여 파일의 모든 줄을 삭제하려면 어떻게 해야 합니까? (0) | 2023.06.01 |
|---|---|
| 안드로이드 애플리케이션에서 충돌 데이터를 가져오려면 어떻게 해야 합니까? (0) | 2023.06.01 |
| Node.jsfs.readdir 재귀 디렉터리 검색 (0) | 2023.06.01 |
| HTML 페이지에서 스크롤 막대 숨기기 (0) | 2023.06.01 |
| getApplication() vs. getApplicationContext() (0) | 2023.06.01 |
