I have a menu application that loads various UIWebViews that are loaded from local HTML files. (this code is in the WebViewController)
vesperswebview.scrollView.bounces = NO;
[[vesperswebview scrollView] setBounces:NO];
[(UIScrollView*)[vesperswebview.subviews objectAtIndex:0] setShowsVerticalScrollIndicator:NO];
NSString *path = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:@"data/html"];
NSURL *url = [NSURL fileURLWithPath:path];
NSString *theAbsoluteURLString = [url absoluteString];
NSString *queryString = @"#?manifest=Psalmody-Morning";
NSString *absoluteURLwithQueryString = [theAbsoluteURLString stringByAppendingString:queryString];
NSURL *finalURL = [NSURL URLWithString:absoluteURLwithQueryString];
NSURLRequest *request = [NSURLRequest requestWithURL:finalURL cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:(NSTimeInterval)10.0];
[vesperswebview loadRequest:request];
I also have a custom date picker called FlatDate Picker: (this code is in my main ViewController). It is related to the imported OpenDatePicker open source project I received from GitHub.
- (void)flatDatePicker:(FlatDatePicker*)datePicker dateDidChange:(NSDate*)date {
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
NSCalendar *coptic = [[NSCalendar alloc] initWithCalendarIdentifier:@"coptic"];
[dateFormatter setCalendar:coptic];
[dateFormatter setDateStyle:NSDateFormatterLongStyle];
if (datePicker.datePickerMode == FlatDatePickerModeDate) {
[dateFormatter setDateFormat:@"EEEE, MMMM, dd, yyyy"];
} else if (datePicker.datePickerMode == FlatDatePickerModeDate) {
[dateFormatter setDateFormat:@"HH:mm:ss"];
} else {
[dateFormatter setDateFormat:@"EEEE, MMMM, dd, yyyy HH:mm:ss"];
}
NSString *value = [dateFormatter stringFromDate:date];
self.labelDateSelected.text = value;
}
My question is: when I select a date in my main view controller, how can this date be saved and passed to the next view in order to load the corresponding Javascript, which is sensitive to the date of time in my database