Re: CoreData code working on Tiger - not on Leopard
Re: CoreData code working on Tiger - not on Leopard
- Subject: Re: CoreData code working on Tiger - not on Leopard
- From: Steve Cronin <email@hidden>
- Date: Tue, 18 Mar 2008 12:46:45 -0500
Folks;
I have a little more data on this issue:
After I have done any insert, if I subsequently call -
processPendingChanges I get an error in CoreData.
There are no pending messages in the log and no custom catch blocks
(other than what is show below).
The debugger halts on the @try command
The Code:
@try { [moc processPendingChanges]; }
@catch ( NSException *e ) {
NSLog(@"%@: Caught %@: %@", NSStringFromSelector(_cmd), [e name],
[e reason]);
}
The Log:
Program received signal: “EXC_BAD_ACCESS”.
The Stack:
#0 0x93d736ec in objc_msgSend
#1 0x9649aed1 in -[NSManagedObjectContext
(_NSInternalChangeProcessing)
_registerUndoForOperation:withObjects:withExtraArguments:]
#2 0x9649adef in -[NSManagedObjectContext
(_NSInternalChangeProcessing) _registerUndoForInsertedObjects:]
#3 0x9649a038 in -[NSManagedObjectContext
(_NSInternalChangeProcessing) _processRecentChanges:]
#4 0x964adbea in -[NSManagedObjectContext processPendingChanges]
#5 0x00089636 in +[DataImporter importSuppotDataInContext:] at
DataImporter.m:75
The Maddening Part:
All of the code works like a charm on Tiger.
I know I must be missing something pretty basic in the Leopard world
but I sure would appreciate a pointer to what that might be!
Thanks!
Steve
On Mar 18, 2008, at 2:33 AM, Steve Cronin wrote:
Folks;
I am now testing a Tiger application on Leopard and learning the
new Leopard way at the same time.
I admit I have a lot of Leoparding to do!
I use Core Data (SQLite) pretty extensively on Tiger - life is good.
I take the project and run it without any changes to the model or
the code and Core Date won't save to disk.
I load a set of data on initial launch and at the end of that
process I have Core Data 'save'.
The data loading all appears to run fine:
recX = [NSEntityDescription
insertNewObjectForEntityForName:@"XYZ" inManagedObjectContext:moc];
[recX setValue:@"123" forKey:@"source"];
...
5 different entities and 1,000s of records..
I've looked over the 'Core Data - Release Notes' but I don't see
anything that seems to indicate a model conversion or persistant
store conversions.... I have not made any changes (no versioning...)
Here's the 'save' code:
- (void) updateCoreData {
NSManagedObject *moc = [self managedObjectContext];
[moc processPendingChanges];
if ([moc commitEditing]) {
NSError *error;
if ([moc save:&error]) {
if (error!=nil) {
On Leopard in the 'processPendingChanges' invocation I get the
following:
0 0x900ef0f4 in ___TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION___
#1 0x93d680fb in objc_exception_throw
#2 0x9649a2a5 in -[NSManagedObjectContext
(_NSInternalChangeProcessing) _processRecentChanges:]
#3 0x964adbea in -[NSManagedObjectContext processPendingChanges]
#4 0x0002032e in -[AppDelegate updateCoreData] at AppDelegate.m:700
BTW: I also get a similar error if, during the loading, I try to
get a 'count' using a FetchTemplate with a null predicate (works on
Tiger)
It appears the fetch also causes a 'processRecentChanges)
What am I missing?
Thanks for your help!
Steve
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden