是否可以在 Cocoa 中绑定空占位符?

发布于 2024-07-14 02:20:26 字数 249 浏览 4 评论 0原文

我有一个表格,其中某些单元格将为零,直到用户填写它们,但我希望我可以更改空占位符(即,当该单元格的特定值为 nil 时它显示的值) code>) 取决于用户已经填写或配置的应用程序的其他部分。 有点像自动完成,但又不完全是。

是否可以绑定空占位符值,或者我必须手动模拟此行为?

编辑:
为了澄清这一点,我正在寻找一种解决方案,为各个单元格提供不同的占位符值,而不是将单个占位符值应用于整个表或整个表列。

I have a table where certain cells will be nil until the user fills them in, but I was hoping that I could change the null place-holder (i.e. the value it displays when the particular value for that cell is nil) depending on other parts of the application the user has already filled in or configured. Sort of like an auto-complete but not quite.

Is it possible to bind the null place-holder value or will I have to emulate this behaviour manually?

Edit:
To clarify, I'm looking for a solution to have distinct place-holder values for individual cells, not a single place-holder value to apply to the entire table or entire table column.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一抹苦笑 2024-07-21 02:20:26

占位符值为 创建绑定时作为选项字典的一部分传递。 由于字典中的值不是可以绑定的,所以我认为没有任何“自动”方法可以做到这一点。

The placeholder value is passed as part of the options dictionary when a binding is created. Since a value in a dictionary is not something that can be bound, I don't think there's any "automatic" way to do this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文