CoreData bug? NSUnknownKeyException thrown when using NSPersistentStoreCoordinator
CoreData bug? NSUnknownKeyException thrown when using NSPersistentStoreCoordinator
- Subject: CoreData bug? NSUnknownKeyException thrown when using NSPersistentStoreCoordinator
- From: "Joe Goh" <email@hidden>
- Date: Tue, 5 Sep 2006 18:00:01 +0800
Hi everyone,
While testing my Palm conduit that uses CoreData, I *think* I have run
into a bug in CoreData, specifically, NSPersistentStoreCoordinator.
All Cocoa/CoreData functionality is located in a bundle which is
loaded at runtime.
Attached below is a snippet of the code:
// ---- CODE SNIPPET BEGIN ---- //
// Initializing managed object model
mom = managedObjectModel();
// Printing out the descriptions seem to indicate that everything is
fine, all my entities are being loaded
NSArray *entities = [mom entities];
int i;
for (i = 0; i < [entities count]; i++)
NSLog(@"%@", [entities objectAtIndex:i];
// Exception thrown here
psc = [[NSPersistentStoreCoordinator alloc]initWithManagedObjectModel:mom];
// ---- CODE SNIPPET END ---- //
The error printed in the console is:
*** Uncaught exception: <NSUnknownKeyException> [<NSCFArray 0x39a100>
valueForUndefinedKey:]: this class is not key value coding-compliant
for the key name.
Because this causes a crash in the app, here's the relevant logs from
the Crash Reporter:
********* BEGIN CRASH REPORT ****************
Thread 3 Crashed:
0 com.apple.Foundation 0x9296e120 _NSRaiseError + 264
1 com.apple.Foundation 0x92a05db4
-[NSObject(NSKeyValueCoding) valueForUndefinedKey:] + 256
2 com.apple.Foundation 0x929b027c _NSGetUsingKeyValueGetter + 76
3 com.apple.Foundation 0x92a0699c
-[NSArray(NSKeyValueCoding) valueForKey:] + 484
4 com.apple.CoreData 0x940b717c
-[NSManagedObjectModel(_NSInternalMethods)
_createCachesAndOptimizeState] + 496
5 com.apple.CoreData 0x940b6eb4
-[NSPersistentStoreCoordinator initWithManagedObjectModel:] + 204
6 ...story.conduitcoredatabundle 0x04670810
persistentStoreCoordinator + 724 (WrappedMethods.m:138)
7 ...story.conduitcoredatabundle 0x046709d4 managedObjectContext +
92 (WrappedMethods.m:172)
8 ...story.conduitcoredatabundle 0x0467263c access_core_data + 440
(WrappedMethods.m:570)
9 ...keestory.funkeestoryconduit 0x046567b0 OpenConduitCarbon + 616
(FunkeeStoryConduit.cp:342)
10 Conduit Manager 0x00415290 0x405000 + 66192
11 Conduit Manager 0x00415f30 0x405000 + 69424
12 Conduit Manager 0x00415b6c 0x405000 + 68460
13 Conduit Manager 0x00417004 0x405000 + 73732
14 Conduit Manager 0x0040f484 0x405000 + 42116
15 Conduit Manager 0x0041b680 0x405000 + 91776
16 Conduit Manager 0x0047249c DoEntry__7LThreadFPv + 60
17 ...ple.CoreServices.CarbonCore 0x90bf0fac InvokeThreadEntryUPP + 24
18 ...ple.CoreServices.CarbonCore 0x90bf0bcc CooperativeThread + 220
19 libSystem.B.dylib 0x9002b508 _pthread_body + 96
********* END CRASH REPORT ****************
The conduit however works flawlessly when run by Missing Sync (by
Mark/Space). Is this a bug in CoreData? Or am I doing something
wrong?
Is there also a workaround for this problem (short of abandoning
CoreData completely and storing the data in some other way)?
Thanks,
Joe
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden