简体   繁体   English

绑定到 NSTreeController 的源列表不显示数据

[英]Source List bound to NSTreeController not showing data

I have a Source List bound to an NSTreeController.我有一个绑定到 NSTreeController 的源列表。 The tree controller has content bound to my view controller with Model keyPath = sidebarItems, which is an NSArray of SidebarItem objects.树控制器将内容绑定到我的视图控制器,模型 keyPath = sidebarItems,它是 SidebarItem 对象的 NSArray。

My NSOutlineView has content bound to the tree controller with Controller Key = arrangedObjects, and both dataSource and delegate connected to my view controller.我的 NSOutlineView 将内容绑定到树控制器,控制器键 = 排列对象,并且数据源和委托都连接到我的视图控制器。

I have extended my view controller for protocols NSOutlineViewDataSource and NSOutlineViewDelegate, and implemented viewFor, isGroupItem, numberOfChildrenOfItem, child and shouldSelectItem.我已经为协议 NSOutlineViewDataSource 和 NSOutlineViewDelegate 扩展了我的视图控制器,并实现了 viewFor、isGroupItem、numberOfChildrenOfItem、child 和 shouldSelectItem。

I have my content array filled with static SidebarItem.我的内容数组填充了静态 SidebarItem。

The problem I'm encountering is none of these functions are called, and so no item is displayed.我遇到的问题是这些函数都没有被调用,所以没有显示任何项目。

显然,我的内容数组必须被声明为动态的 NSTreeController 才能访问它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM