您好我需要将日期选择器与inputView集成,我在Xcode7上。使用以下代码,应用程序会导致异常当我触摸UITextField元素时发生异常。
以下是使用日期选择器的代码的相关部分。
@property (weak, nonatomic) IBOutlet UIDatePicker *graphDate;
@property (weak, nonatomic) IBOutlet UITextField *fromdate;
@property (weak, nonatomic) IBOutlet UITextField *toDate;
............................................................
..............................................................
[_graphDate setDatePickerMode:UIDatePickerModeDateAndTime];
............................................................
..............................................................
[_graphDate setHidden:TRUE];
[_graphDate setFrame:CGRectMake(600, 600, 400, 162)];
_toDate.inputView = _graphDate;
_fromdate.inputView = _graphDate;
_graphDate.date = [NSDate date];
异常消息
Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason:
'child view controller:<UICompatibilityInputViewController: 0x80286850>
should have parent view controller:<VALiveViewController: 0x7cbeda00>
but requested parent is:<UIInputWindowController: 0x7cc25a00>'
我已经在这里回答了UIViewControllerHierarchyInconsistency in 64 bit iOS device,但不知道如何在这里申请,我是IOS的新手。
任何帮助将不胜感激
谢谢,
哈里斯