Rmdateselectionviewcontroller with Uitextfield

Asked

Viewed 150 times

0

I want to put the component RMDateSelectionViewController in my project. I want it to appear when the user touches UITextField. But I’m not getting it, I followed the example code and it didn’t work.

Follows my code:

- (IBAction)openDateSelectionController:(id)sender {

    RMDateSelectionViewController *dateSelectionVC = [RMDateSelectionViewController dateSelectionController];
    dateSelectionVC.delegate = self;

    [dateSelectionVC show];

    dateSelectionVC.datePicker.datePickerMode = UIDatePickerModeDateAndTime;
    dateSelectionVC.datePicker.minuteInterval = 5;
    dateSelectionVC.datePicker.date = [NSDate dateWithTimeIntervalSinceReferenceDate:0];
}

And the error message:

Error: -[Rmdateselectionviewcontroller showFromViewController:] has been called with an instance of Uitableviewcontroller as argument. Showing the date Selection view controller from an instance of Uitableviewcontroller is not possible due to some Internals of Uikit. To Prevent your app from Crashing, Showing the date Selection view controller will be canceled.

Someone knows how to fix this??

1 answer

0


As explained by the author of the control on github, it is not possible to present the Rmdateselectionviewcontroller of a Uitableviewcontroller, but only of Uiviewcontroller due to complications with the apple framework 'Uikit'. Here is a photo of the explanation.

GitHub

On this site there are some other alternatives to solve your problem. https://www.cocoacontrols.com/search?utf8=%E2%9C%93&q=date

  • Rafael, that’s right. I’m going to search another component to test here.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.