Hi Lee Ann,
> On 4 Sep 2015, at 21:25, Lee Ann Rucker <[email protected]> wrote:
>
> NSViewController doesn’t really work that way. It’s like an
> NSWindowController - it manages one view and handles all the nib unloading
> top-level objects stuff for you. (Trust me, you do not want to manage
> top-level objects yourself)
>
> So instead of
>
>> myDetailView = [LTWDetailView loadViewFromNIB:@“ LTWDetailViewY”]l
>> myDetailViewController = [[LTWDetailViewController alloc]
>> initWithDetailView:theDetailView];
>
> what you’d want is
>
> myDetailViewController = [[LTWDetailViewController alloc] initWithNibName:@“
> LTWDetailViewY”]
> myDetailView = [myDetailViewController view];
>
The idea is a have a ViewController with a common Title View already set up in
the view controller NIB file “LTWDetailViewController.xib”.
So doing:
myDetailViewController = [[LTWDetailViewController alloc]
initWithDetailView:nil];
would result in just the header being displayed:
View
TitleView
I then have a number of NIB files that just contain Views (DetailViewX,
DetailViewY etc), I want to load one of them and pass it into
initWithDetailView: so that it adds the view passed to it as a subview, like so:
View
TitleView
DetailViewY
So:
myDetailView = [LTWDetailView loadViewFromNIB:@“ LTWDetailViewY”]l
myDetailViewController = [[LTWDetailViewController alloc]
initWithDetailView:theDetailView];
Would do this.
All the Best
Dave
_______________________________________________
Cocoa-dev mailing list ([email protected])
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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]