cocoa – 跨nib的NSTableView makeViewWithIdentifier

cocoa – 跨nib的NSTableView makeViewWithIdentifier,第1张

概述我有一个类似的问题到 Cocoa – View-Based NSTableView, using one cell in multiple tables,放大了 Apple’s own docs for makeViewWithIdentifier:owner: “Typically identifier is associated with an external NIB in Interfac 我有一个类似的问题到 Cocoa – View-Based NSTableView,using one cell in multiple tables,放大了
Apple’s own docs for makeVIEwWithIDentifIEr:owner:

“Typically IDentifIEr is associated with an external NIB in Interface Builder and the table vIEw will automatically instantiate the NIB with the provIDed owner.”

这似乎暗示您应该能够将NStableCellVIEw存储在包含NStableVIEw的nib的单独nib中.但是,在我的实验中,我只能获得tablevIEw中包含的单元格,我正在调用它.即,如果我将单元格剪切并粘贴到新的.xib文件中,则tablevIEw将无法再找到它.我做错了什么,或者这实际上是不可能的,我在某种程度上误读了Apple的文档?

解决方法 使用 – (voID)registerNib:(NSNib *)nib forIDentifIEr:(Nsstring *)标识符,用于注册要与单元标识符一起使用的nib.

如果它不起作用,你可能在加载tableVIEw数据后注册了nib.使用[tableVIEw reloadData]后来确保它不是时间问题.

总结

以上是内存溢出为你收集整理的cocoa – 跨nib的NSTableView makeViewWithIdentifier全部内容,希望文章能够帮你解决cocoa – 跨nib的NSTableView makeViewWithIdentifier所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/web/1024200.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-23
下一篇2022-05-23

发表评论

登录后才能评论

评论列表(0条)

    保存