Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't set value to UITextField from calendar in popover
    text
    copied!<p>Well, in my application there is textfield, which contains some date. Textfield is not editable for user, but it calling for popover with calendar (Tapku Calendar, BTW). I need to paste selected date in calendar into this textfield. I'v trying this code, but it didn't working for me.</p> <p>Code in Calendar_Popover_Controller.m:</p> <pre><code>// grab (NSString*)Date from calendar and sending it to ChekIn field - (void)calendarMonthView:(TKCalendarMonthView *)monthView didSelectDate:(NSDate *)d { NSDate *calendarSelectedDate = [[NSDate alloc] init]; /* Here is formattedDate */ calendarSelectedDate = [calendar dateSelected]; DateForMainView = [formattedDate stringFromDate:calendarSelectedDate]; ViewController *submittedDateToMainView = [[ViewController alloc] init]; submittedDateToMainView.CheckInField.text = [formattedDate stringFromDate:calendarSelectedDate]; } </code></pre> <p>Also I've check other variant. It seems like this:</p> <p>Calendar_Popover_Controller.m</p> <pre><code>- (void)calendarMonthView:(TKCalendarMonthView *)monthView didSelectDate:(NSDate *)d { NSDate *calendarSelectedDate = [[NSDate alloc] init];; /* formattedDate */ calendarSelectedDate = [calendar dateSelected]; DateForMainView = [formattedDate stringFromDate:calendarSelectedDate]; ViewController *submittedDateToMainView = [[ViewController alloc] init]; submittedDateToMainView.DateFromCalendar = DateForMainView; } </code></pre> <p>Code in ViewController.m:</p> <pre><code>- (BOOL)popoverControllerShouldDismissPopover:(UIPopoverController *)popoverController { [CheckInField setText:DateFromCalendar]; NSLog(@"For CheckIn TextField DateFromCalendar is: %@", DateFromCalendar); NSLog(@"popover about to be dismissed"); return YES; } </code></pre> <p>Here DateFromCalendar == nil anyway. I have no idea to solve this problem.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload