Re: Can I set a custom control's type in a XIB to NSOutlineView?
Re: Can I set a custom control's type in a XIB to NSOutlineView?
- Subject: Re: Can I set a custom control's type in a XIB to NSOutlineView?
- From: Quincey Morris <email@hidden>
- Date: Thu, 28 Jul 2016 10:43:45 -0700
- Feedback-id: 167118m:167118agrif8a:167118sUrXDn2lJC:SMTPCORP
On Jul 28, 2016, at 10:05 , David Burnard <email@hidden> wrote:
>
> So I’m using a custom view, and set it’s type to NSOutlineView.
There are so many things that can go wrong, so you’re going to have to narrow it down.
For example, if you simply changed the custom view type to NSOutlineView, then how did you configure the outline view. In particular, if there weren’t any columns preconfigured, how did you set which is the outline column?
> In my xib file I have an NSTableColumn and an NSTableCellView that I are into IBOutlets on my controller.
You mean these are freestanding objects prebuilt in the XIB? I guess the column might be addable to the table, but what purpose does a prebuilt table cell view serve? That’s not how the table cell mechanism works.
> I tried adding the column via [outlineView addTableColumn:] but afterwards, in the debugger, the _tableColumns array is still nil.
Again, multiple things can go wrong, including attempts to reference an outlet before its value has been set. Looking in the debugger is probably pointless, especially if you’re looking at private variables. You should interrogate the outline view structure programmatically after you attempted to change it, to see if it says you did what you thought you did.
At a higher level, it’s not clear why you’re taking this approach. Why not add a row to the outline view in which you display whatever additional information you want, so you can use the normal scrolling mechanism? Note that group rows span the entire table width, so I’d be inclined to investigate customized group rows instead, or (failing that) to try manipulating the row view instead.
At an even higher level, the fact that you’re doing something that seems difficult may be good reason to question why you’re using this form of UI at all. If the information at the end of the outline view can be scrolled out of the parent view (which is implied by your question), then either it’s not too important or it’s important but invisible a lot of the time. That could mean you either don’t need it, or you should make it more prominently visible. I’d seriously rethink the UI before spending a lot of time hacking NSOutlineView.
_______________________________________________
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