magicalpanda / MagicalRecord

Super Awesome Easy Fetching for Core Data!
Other
10.8k stars 1.79k forks source link

Problem in "+ (instancetype) MR_findFirstWithPredicate:(NSPredicate *)searchTerm andRetrieveAttributes:(NSArray *)attributes inContext:(NSManagedObjectContext *)context" #1172

Open sjacs5537 opened 8 years ago

sjacs5537 commented 8 years ago

Hi, I have a simple Entity called "Test" with two attributes "id" and "testString". When I call:

Test *test = [Test MR_findFirstWithPredicate:[NSPredicate predicateWithFormat:@"id == %@", testid] andRetrieveAttributes:@[@"testString"]];

I got the error:

Core Data: error: -executeRequest: encountered exception = The database appears corrupt.  (invalid primary key) with userInfo = {
    NSFilePath = "/path/mytest.sqlite";