Re: coredata framework daemon-safe?
Re: coredata framework daemon-safe?
- Subject: Re: coredata framework daemon-safe?
- From: "P Smith" <email@hidden>
- Date: Wed, 17 May 2006 14:40:07 +0530
> While saving to a file for the first time, my daemon crashes at
> [ moc save]
OK -- that indicates that one of your managed objects is hosed --
corrupted or over-released --prior to the save.
What does the backtrace look like at the point of the crash?
0 com.apple.Foundation 0x9294d120 _NSRaiseError + 264
1 com.apple.CoreData 0x940d8f34 -[NSManagedObjectContext save:] + 1380
Also, the code you posted includes references to locking/unlocking
the managed object context. That indicates that there is potential
threading going on? What are the other threads doing?
Multiple threads might be using the class I have implemented. Each
time I need to add the entry to the database, I create instance of
NSManagedObjectContext and release it after the operation is
completed.
(relatively straightforward code example deleted)
> Entity *entity = [[[Entity alloc] initWithEntity:myEntity
> insertIntoManagedObjectContext:moc] autorelease];
>
> [ myEntity setName : [NSString stringWithCString: fileName]];
This looks a bit odd. entity then myEntity?
Something similar to the example code:
NSEntityDescription *runEntity = [[mom entitiesByName] objectForKey:@"Run"];
Run *run = [[[Run alloc] initWithEntity:runEntity
insertIntoManagedObjectContext:moc] autorelease];
b.bum
Thanks,
PS
_______________________________________________
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