Re: NSTableView registerNib:forIdentifier: - multiple IDs in a single NIB
Re: NSTableView registerNib:forIdentifier: - multiple IDs in a single NIB
- Subject: Re: NSTableView registerNib:forIdentifier: - multiple IDs in a single NIB
- From: Alex Kac <email@hidden>
- Date: Thu, 14 Jan 2016 16:09:49 -0700
Actually there is - the identifier. You set the NIB *and* the identifier. And I was able to make it work right after I sent the email (isn’t that how it is always?) It seems that my “isNarrow” property wasn’t being set by the time the view was loading where we were initializing it. I wasn’t able to send a confirmation right away as my wife called me for dinner.
So confirmation: multiple views in a single NIB works.
> On Jan 14, 2016, at 4:05 PM, Quincey Morris <email@hidden> wrote:
>
> On Jan 14, 2016, at 14:38 , Alex Kac <email@hidden <mailto:email@hidden>> wrote:
>>
>> I can’t seem to get a good answer to if this should work or not (having multiple cellViews in one NIB).
>
> No. There are 2 top level objects in your nib, but there’s nothing that tells the table view machinery which one to use. (Normally, you’d use outlets in File’s Owner to tell them apart, or iterate through them yourself, looking for — say — a view tag. But there’s nothing that going to make NSTableView do that.)
>
> Instead, you should use two NIBs with different names and one view each.
>
Alex Kac - El capitán
_______________________________________________
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