Re: Best Advice for accessing App Delegate's Managed Object Context
Re: Best Advice for accessing App Delegate's Managed Object Context
- Subject: Re: Best Advice for accessing App Delegate's Managed Object Context
- From: Jerry Krinock <email@hidden>
- Date: Mon, 19 Oct 2015 21:10:16 -0700
> On 2015 Oct 18, at 13:07, Michael de Haan <email@hidden> wrote:
>
> 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! …
Very good, thank you.
> Would you make the child view controllers of the splitViewController a subclass of the splitViewController, or just of an NSViewController?
The question almost answers itself: Your “child view controller” are view controllers. They each control a single view. Conclusion: They should inherit from NSViewController. NSSplitViewController is a thing that controls the splitting of multiple split views, but not the views themselves.
> mySplitViewController : NSSplitViewController
> | |
> | |
> Child1 :?? Child2:??
It is confusing, with the parallel universes of views, view controllers and split views. You might want to fill out your diagram with the other objects on a piece of paper.
_______________________________________________
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