开发者

New to Core Data, getting error in persistentStoreCoordinator

开发者 https://www.devze.com 2023-03-24 20:29 出处:网络
I\'ve just started learning to use Core Data. On my first attempt to add an object to the database, I received the following:

I've just started learning to use Core Data. On my first attempt to add an object to the database, I received the following:

2011-08-03 15:21:32.519 StuffNearMe[45040:15503] Unresolved error Error Domain=NSCocoaErrorDomain Code=134100 "The operation couldn’t be completed. (Cocoa error 134100.)" UserInfo=0x81f03d0 {metadata=<CFBasicHash 0x81efed0 [0x1608ba8]>{type = immutable dict, count = 7,
entries =>
2 : <CFString 0x81ef8f0 [0x1608ba8]&g开发者_StackOverflow社区t;{contents = "NSStoreModelVersionIdentifiers"} = <CFArray 0x81efa00 [0x1608ba8]>{type = immutable, count = 1, values = (
0 : <CFData 0x81ef9d0 [0x1608ba8]>{length = 0, capacity = 0, bytes = 0x}
)}
4 : <CFString 0x81ef920 [0x1608ba8]>{contents = "NSPersistenceFrameworkVersion"} = <CFNumber 0x81efa20 [0x1608ba8]>{value = +363, type = kCFNumberSInt64Type}
6 : <CFString 0x81ef950 [0x1608ba8]>{contents = "NSStoreModelVersionHashes"} = <CFBasicHash 0x81eff50 [0x1608ba8]>{type = immutable dict, count = 2,
entries =>
1 : <CFString 0x81efa30 [0x1608ba8]>{contents = "FavoriteAddress"} = <CFData 0x81efa70 [0x1608ba8]>{length = 32, capacity = 32, bytes = 0x0716904fb7c1b83554338231858021ed ... a0b76e5dbab42a40}
2 : <CFString 0x81efa50 [0x1608ba8]>{contents = "RecentAddress"} = <CFData 0x81eff00 [0x1608ba8]>{length = 32, capacity = 32, bytes = 0x9406126d6ea281dc3e96eed795fc67d8 ... 176c5845b46ca895}
}

7 : <CFString 0x11a7b18 [0x1608ba8]>{contents = "NSStoreUUID"} = <CFString 0x81efc80 [0x1608ba8]>{contents = "D4569F82-247B-4D4E-99DA-990570C0E6B5"}
8 : <CFString 0x11a7988 [0x1608ba8]>{contents = "NSStoreType"} = <CFString 0x11a7998 [0x1608ba8]>{contents = "SQLite"}
9 : <CFString 0x81ef980 [0x1608ba8]>{contents = "_NSAutoVacuumLevel"} = <CFString 0x81effa0 [0x1608ba8]>{contents = "2"}
10 : <CFString 0x81ef9a0 [0x1608ba8]>{contents = "NSStoreModelVersionHashesVersion"} = <CFNumber 0x813f720 [0x1608ba8]>{value = +3, type = kCFNumberSInt32Type}
}
, reason=The model used to open the store is incompatible with the one used to create the store}, {
metadata =     {
    NSPersistenceFrameworkVersion = 363;
    NSStoreModelVersionHashes =         {
        FavoriteAddress = <0716904f b7c1b835 54338231 858021ed a81f0bb5 c0dc6347 a0b76e5d bab42a40>;
        RecentAddress = <9406126d 6ea281dc 3e96eed7 95fc67d8 728976d1 92a0b26a 176c5845 b46ca895>;
    };
    NSStoreModelVersionHashesVersion = 3;
    NSStoreModelVersionIdentifiers =         (
        <>
    );
    NSStoreType = SQLite;
    NSStoreUUID = "D4569F82-247B-4D4E-99DA-990570C0E6B5";
    "_NSAutoVacuumLevel" = 2;
};
reason = "The model used to open the store is incompatible with the one used to create the store";
}

Any help or advice would be greatly appreciated! Core Data is so confusing when you first begin using it.


The error is:

The model used to open the store is incompatible with the one used to create the store

This is likely because you changed the model since you first created it. If you need to change the schema after creating it, take a look at the Core Data Model Versioning and Data Migration Programming Guide.

0

精彩评论

暂无评论...
验证码 换一张
取 消