[missing-sync-palmos-dev-talk] Is this a bug in CoreData,
Palm HotSync, or my app?
Joe Goh
xorandor at gmail.com
Mon Sep 4 20:11:23 PDT 2006
Hi everyone,
I've recently started testing my conduit that uses CoreData using
Palm's HotSync and I have found a bug when calling
NSPersistentStoreCoordinator initWithManagedObjectModel. The conduit
works flawlessly under Missing Sync.
A little bit of background: All Cocoa functionality is placed in a
bundle and loaded at runtime from Carbon.
Here's 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
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 HotSync, here's the relevant log 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 ****************
Has anyone out there encountered anything similar before, or have some
kind of clue why this is happening, and why it only happens using
Palm's HotSync and not on Missing Sync? Or is this bug only relevant
to CoreData and i'm better off posting on a list like CocoaDev?
Thanks!
Joe
More information about the missing-sync-palmos-dev-talk
mailing list