• 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
Re: Best Advice for accessing App Delegate's Managed Object Context
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best Advice for accessing App Delegate's Managed Object Context


  • Subject: Re: Best Advice for accessing App Delegate's Managed Object Context
  • From: Michael de Haan  <email@hidden>
  • Date: Sun, 18 Oct 2015 13:07:31 -0700

Well, there is something to be said for simplifying the code!!!


I got rid of all the notification  code, and substituted this in each controller that needed access to the managedObjectContect

> Just show me how to do that in Swift :)


lazy var managedObjectContext:NSManagedObjectContext! = {

        let appDelegate = NSApplication.sharedApplication().delegate as! AppDelegate
        return appDelegate.managedObjectContext

        }()


There is one question now…. :-)

Would you make the   child view controllers of the splitViewController a subclass of the splitViewController, or just of an NSViewController?

So, should the hierarchy be :




mySplitViewController  : NSSplitViewController
|                                |
|                                |
|                                |
|                                |
|                                |
|                                |
|                                |
|                                |
|                                |
|                                |
|                                |
|                                |
|                                |
|                                |
Child1 :??                Child2:??

Should be ?NSViewController, or mySplitViewController?
_______________________________________________

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: Best Advice for accessing App Delegate's Managed Object Context
      • From: Jerry Krinock <email@hidden>
References: 
 >Best Advice? (From: Michael de Haan  <email@hidden>)
 >Re: Best Advice for accessing App Delegate's Managed Object Context (From: Jerry Krinock <email@hidden>)
 >Re: Best Advice for accessing App Delegate's Managed Object Context (From: Michael de Haan  <email@hidden>)
 >Re: Best Advice for accessing App Delegate's Managed Object Context (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Best Advice for accessing App Delegate's Managed Object Context
  • Next by Date: Re: NSButton with NSTexturedRoundedBezelStyle outside of NSToolbar
  • Previous by thread: Re: Best Advice for accessing App Delegate's Managed Object Context
  • Next by thread: Re: Best Advice for accessing App Delegate's Managed Object Context
  • Index(es):
    • Date
    • Thread