在运行时使用 NSUserDefaults 更改 PickerView 组件的数量

发布于 2024-12-03 04:02:10 字数 198 浏览 5 评论 0原文

大家好,我是 iPhone 编程新手 我创建了一个带有选项卡栏的应用程序。在一个视图中,有一个选择器视图,在其他视图中,我在要更改选择器组件数量的位置放置了一个滑块。即使我使用 nsuserdefaults 然后重新加载所有组件,选择器组件的数量也不会改变。 有人可以帮助解决这个问题吗?这两者如何在不使用设置捆绑包而仅使用 nsuserdefaults 的情况下进行通信? 谢谢

Hello everybody Im a newbie about iPhone programming
I created an application with a tab bar.In one view there's a picker view in other view I put a slider where I want change the number of the components of the picker. Even if I use nsuserdefaults and then reloadAllcomponents the number of picker component doesn't change.
Can someone help to resolve this issue? How can this two communicate without use setting bundle but only nsuserdefaults?
Thanks

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

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

发布评论

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

评论(1

你爱我像她 2024-12-10 04:02:10

您需要在一个类中写入它们之后并在其他类中读取它们之前[[NSUserDefaults standardUserDefaults]同步];

You need to [[NSUserDefaults standardUserDefaults] synchronize]; after writing to them in one class and before reading in other class?

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