2013-08-07 2 views
0

내 앱에 두 개의 tableView가 있는데 두 사용자 모두에 개체를 추가 할 수 있어야합니다. 하나의 tableView로 잘 작동합니다 (하나의 coreData 만 있습니다 엔티티). 그러나 다른 엔터티를 추가하고 하나의 tableView와 동일한 작업을 수행하면 xcode에서 오류를 표시합니다. 나는 시간이 문제를 해결하기 위해 노력했습니다CoreData- 두 엔티티가있는 프로젝트

Unresolved error Error Domain=NSCocoaErrorDomain Code=134100 "The operation couldn’t be completed. (Cocoa error 134100.)" UserInfo=0x10333d80 {metadata={ 
    NSPersistenceFrameworkVersion = 419; 
    NSStoreModelVersionHashes =  { 
     Buy = <883135e4 2884b0ed 4bb8fc1c 7d56c229 fbae3090 91be719d 73ac5d66 65e70b18>; 
    }; 
    NSStoreModelVersionHashesVersion = 3; 
    NSStoreModelVersionIdentifiers =  (
     "" 
    ); 
    NSStoreType = SQLite; 
    NSStoreUUID = "..."; 
    "_NSAutoVacuumLevel" = 2; 
}, reason=The model used to open the store is incompatible with the one used to create the store}, { 
    metadata =  { 
     NSPersistenceFrameworkVersion = 419; 
     NSStoreModelVersionHashes =   { 
      Buy = <883135e4 2884b0ed 4bb8fc1c 7d56c229 fbae3090 91be719d 73ac5d66 65e70b18>; 
     }; 
     NSStoreModelVersionHashesVersion = 3; 
     NSStoreModelVersionIdentifiers =   (
      "" 
     ); 
     NSStoreType = SQLite; 
     NSStoreUUID = "..."; 
     "_NSAutoVacuumLevel" = 2; 
    }; 
    reason = "The model used to open the store is incompatible with the one used to create the store"; 
} 
(lldb) 

, 그러나 나는 처음과 두 번째있는 tableView에서 같은 일을했다 :

출력이다.

누군가 나를 도울 수 있습니다. 당신이 당신의 모델을 설계 할 때 advancen

+0

"저장소를 여는 데 사용한 모델이 호환되지 않습니다 ..."오류 메시지가 검색 되었습니까? 몇 가지 안타가 있어야합니다 ... –

답변

0

감사 당신은 마이그레이션을 수행해야합니다

http://developer.apple.com/library/ios/#documentation/cocoa/Conceptual/CoreDataVersioning/Articles/Introduction.html

그래서 당신이해야 할 첫 번째 일은 새로운 모델 버전을 만들 수 있습니다.

필드 및 엔터티 추가와 같은 이유로 coredata는 간단한 마이그레이션을 통해 자동으로 수행 할 수 있습니다. 보다 복잡한 작업을 수행하려면 매핑 모델을 만들어야합니다.

앱이 상점에없고 사용자가없는 경우 마이그레이션을 전혀 염려 할 필요가 없습니다. 휴대 전화/시뮬레이터에서 앱을 삭제하고 앱을 실행하십시오. 상점에 앱이 있다면 절대적으로 새로운 모델 버전을 지정하고 이전을해야합니다.