I am using a table view controller in story board which contains a custom table view cell in which a 2 labels and one button is the elements. I need to get a ui popover with date picker when I click on button in custom table view cell. It is not possible to give a direct segue connection from cell to dateViewcontroller as popover.
Please suggest me some ideas.
if ([segue.identifier isEqualToString:@"segueToDate"])
{
DatePickerViewController *dateVC = [[DatePickerViewController alloc] init];
dateVC =[segue destinationViewController];
dateVC.delegate = self;
dateVC.pickerType = @"date";
_popover = [[UIPopoverController alloc] initWithContentViewController:dateVC];
_popover = [(UIStoryboardPopoverSegue *)segue popoverController];
[_popover presentPopoverFromRect:selectedCell.checkboxBtn.frame inView:selectedCell permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];
// [datePopover setDelegate:self];
}
error log is here:
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIPopoverController _commonPresentPopoverFromRect:inView:permittedArrowDirections:animated:]: Popovers cannot be presented from a view which does not have a window.'