Core Data Managed Object Context Problem
Core Data Managed Object Context Problem
- Subject: Core Data Managed Object Context Problem
- From: Philip Bridson <email@hidden>
- Date: Tue, 05 Feb 2008 14:41:24 -0800
Hi there,
I need to make my Managed Object Context that is in one file available to several other files. I have tried many tactics which include passing it in to a class as an argument to a function for example
NSManagedObjectContext *moc... //Assume this exists
[someObject setManagedObjectContext:moc];
This works fine from the file that contains the original moc to a single separate class but if I do it to a second file it crashes and says EXC_BAD_ACCESS.
Also if I use the documented way from core data e.g
-(NSManagedObjectContext *)managedObjectContext
{
return moc;
}
it still gives me a EXC_BAD_ACCESS if I use it on multiple files.
The only way I have found is if all my windows are in the same nib and I use an IBOutlet to where the moc is. But what if I don't want all my eggs in one basket? How do I do it. Any idea's would be grateful.
Many thanks.
Phil
_______________________________________________
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