• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Core Data Managed Object Context Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: NSDrawerOpeningState woes
  • Next by Date: Re: CoreData: Can't modify an immutable model
  • Previous by thread: Re: CoreData: Can't modify an immutable model
  • Next by thread: Transferring data between Python and Cocoa (maybe a newbie question)
  • Index(es):
    • Date
    • Thread