简体   繁体   English

UIDatePicker在更改值时崩溃

[英]UIDatePicker is crashing on value changed

I have created a method and connected it with value changed event of UIDatePicker, but as soon as I changed the value the app. 我创建了一个方法,并将其与UIDatePicker的值更改事件相关联,但是一旦我更改了应用程序的值,就可以将其连接。 crashes. 崩溃。

If I remove the connection of UIDatePicker's value changed to my method in Interface builder, then app does not crash. 如果我删除了在接口构建器中更改为我的方法的UIDatePicker值的连接,则应用程序不会崩溃。

Can I not connect value change to my own method for UIDatePicker? 我不能将值更改连接到我自己的UIDatePicker方法吗?

Please provide the code that is present in the Event handler function. 请提供事件处理程序函数中提供的代码。

If at all, you have a custom View Controller in your app and you have your picker on the View of this view controller, check in your Nib file, the class name that implements your nib viewController. 如果有的话,您的应用程序中有一个自定义的View Controller,并且在此View Controller的View上有选择器,请签入Nib文件,该文件名实现了您的nib viewController。 If it is UIViewController, change the name to the Custom ViewController class name. 如果是UIViewController,请将名称更改为Custom ViewController类名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM