I am writing an iphone app using xcode 4.2 and it involves coredata. everything was perfectly fine until I cleaned the project. then I constantly get the following error: Reason = "The model used to open the store is incompatible with the one used to create the store". If I use
NSString *storePath = [[self applicationDocumentsDirectory] stringByAppendingPathComponent: @"ChildCare_v02.sqlite"];
NSURL *storeUrl = [NSURL fileURLWithPath:storePath];
I get the error above and if I use:
NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"ChildCare_v02.sqlite"];
It retrieves 0 row from my database file,anyone has any idea?
I should mention that the store that I use is not empty and I fill it in with data using another application. (by this I mean I copy the coredata store file from one app to be used in another app.)
Finally, to fix the problem I added some lines of code with in my program to read the records from a sqlite database file and fill the coredata store related to the app. and it worked. I removed the store and ran the sqlite2coredata function once and now my application is working.