Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency',

后端 未结 5 1893
借酒劲吻你
借酒劲吻你 2020-12-16 14:59

I created a toolbar above the picker with two buttons and worked on ios7, when i run in ios8 crash:

Terminating app two to uncaught exception \'UIVi

5条回答
  •  误落风尘
    2020-12-16 15:41

    UIDatePickerView should not be child class of any super view

    Problem:

    You have to ensure that the view you will assign to inputView or inputAccessoryView don't belong to any parent view. Maybe when you create these views from xib inside a ViewController, by default they are subviews of a superview.

    Solution Tips:

    Using method removeFromSuperview for view you will assign to inputView or inputAccessoryView

提交回复
热议问题