有谁知道如何用核心数据填充选择器控制器

发布于 2024-08-27 20:54:29 字数 113 浏览 4 评论 0原文

我正在尝试用核心数据而不是数组填充 UIPicker,但我一生都无法弄清楚如何做到这一点...请有人指出我可以做什么的正确方向我完全陷入困境......

非常感谢

Stef :-)

I'm trying to populate the UIPicker with Core Data instead of an array but can't for the life of me figure out how to do it... Please can someone point me in the right direction as to what I can do as I'm completely stuck...

Thanx a lot

Stef :-)

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

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

发布评论

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

评论(1

落墨 2024-09-03 20:54:29

类似的帖子应该有所帮助。

您可以轻松地使用核心数据来提取数组,然后在 UIPickerView 数据源和委托方法中使用该数组。您是否需要获取一次,或者需要更改搜索字符串,取决于您的应用程序行为。您无法将核心数据直接连接到 UIPickerView 等 UI 元素。

A similar post should help.

You can easily use core data to do a fetch in to an array, then use this array in the UIPickerView data source and delegate methods. Whether you need to fetch once, or for a changing search string say, is up to your application behaviour. You can't wire-up core data to UI elements like UIPickerView directly.

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