UIPickerView:无法识别的选择器发送到实例 - 仅在 ios 3.1.x 上
我有一个 UIViewController,它有一个 UIPickerView。正如您所期望的,选择器的数据源和委托是我的控制器。
我的控制器实现了 UIPickerViewDelegate 和 UIPickerViewDataSource 协议以及所需的所有方法: numberOfComponentsInPickerView
、numberOfRowsInComponent
、titleForRow
和 didSelectRow
它在 ios 4 上运行良好,但在 3.1 上崩溃并带有一个漂亮的 <当我调用 [picker reloadInputViews]
时,代码>“无法识别的选择器发送到实例” (它甚至没有到达委托或数据源方法中的断点)。
我看不出这里缺少什么(很高兴需要发布代码)
非常感谢您的帮助!
I have a UIViewController that has a UIPickerView. The picker's datasource and delegate are my controller as you would expect.
My controller implements the UIPickerViewDelegate
and UIPickerViewDataSource
protocols and all the methods that are required:numberOfComponentsInPickerView
, numberOfRowsInComponent
, titleForRow
and didSelectRow
It's all working well on ios 4 but crashes on 3.1 with a nice "unrecognized selector sent to instance"
as soon as I call [picker reloadInputViews]
(It doesn't even reach breakpoints in the delegate or datasource methods).
I can't see what's missing here (happy to post code is needed)
Many thanks for your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该调用
[picker reloadAllComponents]
。reloadInputViews
是UIResponder
的一种方法,仅自 iOS 3.2 起可用。至少根据文档。你应该读一下。You should call
[picker reloadAllComponents]
.reloadInputViews
is a method ofUIResponder
and only available since iOS 3.2. At least according to the documentation. Which you should read.