带有数据源的 NSTableView 中的 NSDateFormatter

发布于 2024-12-02 02:31:48 字数 304 浏览 5 评论 0原文

我正在尝试在表视图中的单元格上使用 NSDateFormatter 。我的表视图使用数据源而不是 NSArrayController。

由于某种原因,当我输入日期时,setObjectValue:forTableColumn... 会获取时区为 -0000 的日期。我在 IB 中设置了格式化程序,并且还尝试在委托方法 dataCellForTableColumn 中进行设置。

为什么 NSDateFormatter 不保留时区?

I am trying to use the NSDateFormatter on a cell in a table view. My table view uses a dataSource not an NSArrayController.

For some reason, when I enter a date, the setObjectValue:forTableColumn... gets a date with ‑0000 timezone. I set the formatter in IB and I also tried setting in the delegate method dataCellForTableColumn.

Why doesn't the NSDateFormatter keep the time zone?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文