gpt4 book ai didi

cocoa - NSPopupButton 单元格绑定(bind)问题

转载 作者:行者123 更新时间:2023-12-03 18:02:10 25 4
gpt4 key购买 nike

我正在尝试实现类似于 Apple Master-Detail pop-up cell example 的目标但绑定(bind)似乎不适合我。

我的应用程序允许用户构建舞台剧;所以我有一个 TableView acts 。每个行为可以有一个列表 lines因此,行为 TableView 驱动第二个台词 TableView (因此选择第一幕会使用该幕的台词更新台词 TableView )。

此设置似乎运行良好。

每一行当然都是由一个角色说出的,所以我的文档对象有一个列表 characters以及行为 list 。我想要的是行表中的弹出单元格,其中的值取自 characters数组。

所以我按照苹果教程中的步骤操作,但它不起作用......

  • 如果我绑定(bind)content TableView 列的 CharactersController.arrangedObjectsselectedObjectLinesController.arrangedObjects.character然后绑定(bind)起作用(当我从弹出窗口中选择一个值时,它会使用新字符更新底层 line 对象),列表显示 <Character ...>条目
  • 如果我随后绑定(bind)该列的 contentValuesCharactersController.arrangedObjects.name然后,当我运行应用程序时,出现以下调试错误:

    2011-03-16 11:28:49.783 ScriptPreparer[5176:903] Cocoa Bindings: 
    Error setting value <Character: 0x100144f60> of object
    <NSPopUpButtonCell: 0x100153ff0> through binding selectedObject
  • 如果我删除 selectedObject绑定(bind)然后我仍然得到 <Character...>输出到列表中。

看起来像contentValues绑定(bind)是破损的。我做错了什么?

这是我的绑定(bind): enter image description here

最佳答案

我发现了问题所在 - 我在 NSTableView 上设置了绑定(bind)以及表列和 NSPopupButtonCell这导致了奇怪的事情发生。

我现在的结论是任何不在表列上的表绑定(bind)都是错误的

关于cocoa - NSPopupButton 单元格绑定(bind)问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5324676/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com