在运行时使用 NSUserDefaults 更改 PickerView 组件的数量
大家好,我是 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要在一个类中写入它们之后并在其他类中读取它们之前
[[NSUserDefaults standardUserDefaults]同步];
?You need to
[[NSUserDefaults standardUserDefaults] synchronize];
after writing to them in one class and before reading in other class?