选择器视图出现问题

发布于 2024-10-10 00:50:25 字数 271 浏览 0 评论 0原文

我正在使用双组件实现选择器视图,通过选择切换按钮来切换摄氏和华氏度两个选择器视图。两个选择器视图都在加载我的应用程序并获取切换。但我缺少我的组件值。请帮助我,这里我附上了我的选择器项目。

http://www.ziddu.com/download/13259414/TemperaturePicker.zip.html

I am implementing picker view with double component Toggle with Celsius and Fahrenheit two picker views by selecting toggle button. Both the picker view is loading my app and getting toggle . But i am missing my components values ., please help me , here i attached my picker project.

http://www.ziddu.com/download/13259414/TemperaturePicker.zip.html

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

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

发布评论

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

评论(1

浪菊怪哟 2024-10-17 00:50:25

我在您的代码中发现了两个问题:

  • 在方法 updateLabel 中,您应该重新加载 pickerview:

    [pickerView reloadAllComponents];

  • 你的NSObject-类CelsiusFahrenheit不是ViewControllers,这意味着viewDidLoad不会被执行并且包含数据的数组将不会被初始化。

最好你写一个像这样的初始化程序:

- (id)init {        
       /* initialize data-arrays here */
       return self;             
}

I've found two problems in your code:

  • In the method updateLabel you should reload the pickerview:

    [pickerView reloadAllComponents];

  • Your NSObject-Classes Celsius and Fahrenheit are not ViewControllers, which means that viewDidLoad won't be executed and the array containing the data will not be initialized.

Better you write an initializer like this:

- (id)init {        
       /* initialize data-arrays here */
       return self;             
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文