• 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
Getting managedObject Context
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting managedObject Context


  • Subject: Getting managedObject Context
  • From: Clayton Leitch <email@hidden>
  • Date: Sat, 29 Aug 2009 18:59:07 -0400

I have spent the last month try to solve a simple problem. I need to get the managedObjectContext in a NSDocument based application. I know how to get this in a non-document based application
-(NSManagedObjectContect *)managedObjectContext {
if (!managedObjectContext) {
managedObjectContext = [[NSApp delegate] managedObjectContext];
}
return managedObjectContext;
}


From the documentation it appears that I get the managedObject Context from the MyDocument instead of the application delegate. I tried a similar structure to the above replacing NSApp delegate with MyDocument. Does anyone have an example of getting the manageObjectContext from the MyDocument class?

Please no flames,
I have read the core data programming guide. I may have missed the reference.
_______________________________________________


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


  • Follow-Ups:
    • Re: Getting managedObject Context
      • From: Gideon King <email@hidden>
    • Re: Getting managedObject Context
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: virtual ivars
  • Next by Date: Re: Getting managedObject Context
  • Previous by thread: Copying records from to-many relationship in Core Data
  • Next by thread: Re: Getting managedObject Context
  • Index(es):
    • Date
    • Thread