ios - Crash during Core Data store migration -


i have app in app store , works fine. i'm developing update app, when update installed on original app app crashes right on line below:

let userstore: nspersistentstore? = coordinator!.addpersistentstorewithtype(nssqlitestoretype, configuration: "userdata", url: storeurl, options: self.storeoptions() [nsobject : anyobject], error: &erroruser) 

the storeoptions() function is:

func storeoptions() -> nsdictionary {         return [nsmigratepersistentstoresautomaticallyoption:true,             nsinfermappingmodelautomaticallyoption:true,             nspersistentstoreremoveubiquitousmetadataoption:true] nsdictionary     } 

the crash is:

terminating app due uncaught exception 'nsinvalidargumentexception', reason: 'can't use fetch request fetched property description (entity model mismatch).'

i created new version of model core data.the differences between core data versions are: 1) 5 fetched properties added; 2) 1 entity added.

if core data store has few objects migrate, works fine without crash; if store have hundreds objects migrate, crash occurs. crash happens first time run app after update. after crash, if re-launch app 1 or 2 times, works fine.

thanks help!

this console log migration debug activated:

2015-05-11 15:47:25.635 medability[36991:4938505] coredata: annotation: incompatible version schema persistent store 'file:///var/mobile/containers/data/application/f2e6cd21-1f14-45e4-8522-d3b21e6c2129/documents/medability.sqlite'.  store metadata = {     nspersistenceframeworkversion = 519;     nsstoremodelversionhashes =     {         area = <af6226b7 0266c871 51907548 889dd0a0 cd8bb41b a5fac48e a9b6b26d 2c302f51>;         argomento = <78466321 1b0def24 d9fd617b a5293137 6a500d03 7c970176 bd0a6fff 4119ba6a>;         domanda = <e43a3011 c52b29d5 baa25106 2d620206 f896a866 c17f66f4 83dfe95f 5bb64011>;         preferita = <2fd53f7e ae85e1e5 955d512e 96f33ec4 b25b5bb4 0298d201 cb5e0578 02a8ae84>;         risposta = <cf5ea36c e2885c4a 1ea1a929 801ed4f0 35069831 911e599d 1fb011dd 9817833d>;         statdomanda = <b4a01246 05e5504a 8c73ebcd d857b549 1ed3cb8a d0ada1eb f7e63fea 1971ef09>;         statsimulazione = <2ebd70dc 7b935642 75957196 68eab9c4 6d53bfb7 acf7ed28 fc859da3 742e06f3>;     };     nsstoremodelversionhashesversion = 3;     nsstoremodelversionidentifiers =     (         ""     );     nsstoretype = sqlite;     nsstoreuuid = "f74702c7-518c-4dcf-9555-1895dff79608";     "_nsautovacuumlevel" = 2; } , current model versions = {     area = <af6226b7 0266c871 51907548 889dd0a0 cd8bb41b a5fac48e a9b6b26d 2c302f51>;     argomento = <78466321 1b0def24 d9fd617b a5293137 6a500d03 7c970176 bd0a6fff 4119ba6a>;     domanda = <e43a3011 c52b29d5 baa25106 2d620206 f896a866 c17f66f4 83dfe95f 5bb64011>;     preferita = <2fd53f7e ae85e1e5 955d512e 96f33ec4 b25b5bb4 0298d201 cb5e0578 02a8ae84>;     risposta = <cf5ea36c e2885c4a 1ea1a929 801ed4f0 35069831 911e599d 1fb011dd 9817833d>;     segnalibro = <7edc9c5d 72fd8f12 703cfbd8 c3e46ae7 71c7708d bbd096c5 5d278d18 40a43d38>;     statdomanda = <b4a01246 05e5504a 8c73ebcd d857b549 1ed3cb8a d0ada1eb f7e63fea 1971ef09>;     statsimulazione = <2ebd70dc 7b935642 75957196 68eab9c4 6d53bfb7 acf7ed28 fc859da3 742e06f3>; } 2015-05-11 15:47:25.637 medability[36991:4938505] coredata: annotation: (migration) attempt automatic schema migration 2015-05-11 15:47:25.804 medability[36991:4938505] coredata: annotation: (migration) looking mapping model source hashes: {     area = <af6226b7 0266c871 51907548 889dd0a0 cd8bb41b a5fac48e a9b6b26d 2c302f51>;     argomento = <78466321 1b0def24 d9fd617b a5293137 6a500d03 7c970176 bd0a6fff 4119ba6a>;     domanda = <e43a3011 c52b29d5 baa25106 2d620206 f896a866 c17f66f4 83dfe95f 5bb64011>;     preferita = <2fd53f7e ae85e1e5 955d512e 96f33ec4 b25b5bb4 0298d201 cb5e0578 02a8ae84>;     risposta = <cf5ea36c e2885c4a 1ea1a929 801ed4f0 35069831 911e599d 1fb011dd 9817833d>;     statdomanda = <b4a01246 05e5504a 8c73ebcd d857b549 1ed3cb8a d0ada1eb f7e63fea 1971ef09>;     statsimulazione = <2ebd70dc 7b935642 75957196 68eab9c4 6d53bfb7 acf7ed28 fc859da3 742e06f3>; } destination hashes: {     area = <af6226b7 0266c871 51907548 889dd0a0 cd8bb41b a5fac48e a9b6b26d 2c302f51>;     argomento = <78466321 1b0def24 d9fd617b a5293137 6a500d03 7c970176 bd0a6fff 4119ba6a>;     domanda = <e43a3011 c52b29d5 baa25106 2d620206 f896a866 c17f66f4 83dfe95f 5bb64011>;     preferita = <2fd53f7e ae85e1e5 955d512e 96f33ec4 b25b5bb4 0298d201 cb5e0578 02a8ae84>;     risposta = <cf5ea36c e2885c4a 1ea1a929 801ed4f0 35069831 911e599d 1fb011dd 9817833d>;     segnalibro = <7edc9c5d 72fd8f12 703cfbd8 c3e46ae7 71c7708d bbd096c5 5d278d18 40a43d38>;     statdomanda = <b4a01246 05e5504a 8c73ebcd d857b549 1ed3cb8a d0ada1eb f7e63fea 1971ef09>;     statsimulazione = <2ebd70dc 7b935642 75957196 68eab9c4 6d53bfb7 acf7ed28 fc859da3 742e06f3>; } 2015-05-11 15:47:25.811 medability[36991:4938505] coredata: annotation: (migration) checking mapping model /private/var/mobile/containers/bundle/application/9cc3c576-aecb-4a57-9736-d84362930f86/medability.app/mappingmodel.cdm source hashes: {(     <51547408 0740f420 b6856444 4c3c831e 3bc0f6fb 6aee554a 873c28f4 3f79869d>,     <cf5ea36c e2885c4a 1ea1a929 801ed4f0 35069831 911e599d 1fb011dd 9817833d>,     <dca9a9da 863a890a 75944b3d cad52b45 ad9e87c3 d4c5e157 4d00600f f66ce9e4>,     <78466321 1b0def24 d9fd617b a5293137 6a500d03 7c970176 bd0a6fff 4119ba6a>,     <e04dcc45 a70018ae 00de4f4d ef5378ae 3de3b718 6a961ae9 b916288e 14573c83> )} destination hashes: {(     <af6226b7 0266c871 51907548 889dd0a0 cd8bb41b a5fac48e a9b6b26d 2c302f51>,     <e43a3011 c52b29d5 baa25106 2d620206 f896a866 c17f66f4 83dfe95f 5bb64011>,     <2fd53f7e ae85e1e5 955d512e 96f33ec4 b25b5bb4 0298d201 cb5e0578 02a8ae84>,     <cf5ea36c e2885c4a 1ea1a929 801ed4f0 35069831 911e599d 1fb011dd 9817833d>,     <b4a01246 05e5504a 8c73ebcd d857b549 1ed3cb8a d0ada1eb f7e63fea 1971ef09>,     <2ebd70dc 7b935642 75957196 68eab9c4 6d53bfb7 acf7ed28 fc859da3 742e06f3>,     <78466321 1b0def24 d9fd617b a5293137 6a500d03 7c970176 bd0a6fff 4119ba6a> )} 2015-05-11 15:47:25.812 medability[36991:4938505] coredata: annotation: (migration) mismatched source ,  hashes mapping model mappingmodel.cdm 2015-05-11 15:47:25.812 medability[36991:4938505] coredata: annotation: (migration) no match found 5 of 7 mapping model source hashes 2015-05-11 15:47:25.817 medability[36991:4938505] coredata: annotation: (migration) checking mapping model /system/library/privateframeworks/notes.framework/externalsequencenumbertoattachmentmappingmodel.cdm source hashes: {(     <0f8744bb 376b0605 81c1356b 4a5cd8ce 297be0d7 76945132 057fb167 7514a61c>,     <ed35016c 16ce0c08 62093859 d635d684 c45984e6 053e9bff bf658180 3280b941>,     <9419ea78 017a215a f515f895 8a29c4a1 78b2bbd2 1a717a07 b383378f f0ae4b78>,     <e5d70b6b 962b999a 13401655 abb95b65 3048836f 47ea07c3 27d40938 5659382b>,     <2591278c 6d7773dd 13079513 fef234f6 e8f58e5a ca00f5d2 de2ab6f4 56b5b614>,     <06ae957e c9080f85 7cbd5291 4d16c9f4 9d86e1f8 92019b63 e8af3bc6 08735b9c>,     <14f5af3b 1601e79c e2a3674d d30d39ea eb55377f 132c73e9 30b9be3f 861b0450> )} destination hashes: {(     <68b4bd84 a77d29ef 5129d209 0bb2d107 1f549168 8eb1c43c 08e8aeb7 eece004a>,     <0f8744bb 376b0605 81c1356b 4a5cd8ce 297be0d7 76945132 057fb167 7514a61c>,     <e5d70b6b 962b999a 13401655 abb95b65 3048836f 47ea07c3 27d40938 5659382b>,     <14f5af3b 1601e79c e2a3674d d30d39ea eb55377f 132c73e9 30b9be3f 861b0450>,     <3cac738a 7e9ab953 8d2e8dd0 11c60c82 4f8dfbe4 be285cbb e0fd4d7f 003784ab>,     <2591278c 6d7773dd 13079513 fef234f6 e8f58e5a ca00f5d2 de2ab6f4 56b5b614>,     <06ae957e c9080f85 7cbd5291 4d16c9f4 9d86e1f8 92019b63 e8af3bc6 08735b9c>,     <2468f7b0 631a290c bc83720a 7287e359 3c222e59 057e9deb 6a13bd85 339bd5ef> )} 2015-05-11 15:47:25.817 medability[36991:4938505] coredata: annotation: (migration) mismatched source , destination hashes mapping model externalsequencenumbertoattachmentmappingmodel.cdm 2015-05-11 15:47:25.818 medability[36991:4938505] coredata: annotation: (migration) no suitable mapping model found 2015-05-11 15:47:25.818 medability[36991:4938505] coredata: annotation: (migration) inferring mapping model between data models source hashes: {     area = <af6226b7 0266c871 51907548 889dd0a0 cd8bb41b a5fac48e a9b6b26d 2c302f51>;     argomento = <78466321 1b0def24 d9fd617b a5293137 6a500d03 7c970176 bd0a6fff 4119ba6a>;     domanda = <e43a3011 c52b29d5 baa25106 2d620206 f896a866 c17f66f4 83dfe95f 5bb64011>;     preferita = <2fd53f7e ae85e1e5 955d512e 96f33ec4 b25b5bb4 0298d201 cb5e0578 02a8ae84>;     risposta = <cf5ea36c e2885c4a 1ea1a929 801ed4f0 35069831 911e599d 1fb011dd 9817833d>;     statdomanda = <b4a01246 05e5504a 8c73ebcd d857b549 1ed3cb8a d0ada1eb f7e63fea 1971ef09>;     statsimulazione = <2ebd70dc 7b935642 75957196 68eab9c4 6d53bfb7 acf7ed28 fc859da3 742e06f3>; } destination hashes: {     area = <af6226b7 0266c871 51907548 889dd0a0 cd8bb41b a5fac48e a9b6b26d 2c302f51>;     argomento = <78466321 1b0def24 d9fd617b a5293137 6a500d03 7c970176 bd0a6fff 4119ba6a>;     domanda = <e43a3011 c52b29d5 baa25106 2d620206 f896a866 c17f66f4 83dfe95f 5bb64011>;     preferita = <2fd53f7e ae85e1e5 955d512e 96f33ec4 b25b5bb4 0298d201 cb5e0578 02a8ae84>;     risposta = <cf5ea36c e2885c4a 1ea1a929 801ed4f0 35069831 911e599d 1fb011dd 9817833d>;     segnalibro = <7edc9c5d 72fd8f12 703cfbd8 c3e46ae7 71c7708d bbd096c5 5d278d18 40a43d38>;     statdomanda = <b4a01246 05e5504a 8c73ebcd d857b549 1ed3cb8a d0ada1eb f7e63fea 1971ef09>;     statsimulazione = <2ebd70dc 7b935642 75957196 68eab9c4 6d53bfb7 acf7ed28 fc859da3 742e06f3>; } 2015-05-11 15:47:25.878 medability[36991:4938505] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: 'can't use fetch request fetched property description (entity model mismatch).' *** first throw call stack: (0x1847b82d8 0x195fdc0e4 0x1847b8218 0x1844e6310 0x1844e6468 0x1844dd7c4 0x184511694 0x184449564 0x18444922c 0x18457f494 0x18451e168 0x1845780ec 0x184577180 0x184578ad8 0x1845281c0 0x184534028 0x100894f94 0x10089f08c 0x184525e98 0x1844496e8 0x1000bc0d4 0x1000bb074 0x1000ba544 0x10015ff84 0x10016092c 0x1891f8c84 0x1892aef68 0x1892aee64 0x1892ae2f0 0x1892adf9c 0x1892adcbc 0x1892adc3c 0x1891f5760 0x188b3de1c 0x188b38884 0x188b38728 0x188b37ebc 0x188b37c3c 0x189484838 0x18948571c 0x189483778 0x18cfc13c8 0x18477027c 0x18476f384 0x18476d9a8 0x1846992d4 0x18926443c 0x18925efac 0x10007bc90 0x19665aa08) libc++abi.dylib: terminating uncaught exception of type nsexception (lldb) 


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -