I have two views, first one is with calendar and the second one is a UIView with a tableView;
I’m trying to display the selected date from the firstView. Managed to get the selected date inside ViewDidLoad method of my secondView.
How I add my NSDate to my - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section method?
Declare an
@property (nonatomic, retain) NSDate *displayDate;(orstronginstead ofretainwhen using ARC) on your TableViewController (dont forget to synthesize). The first view can then set the property of the TableViewController, for example:You can then access the date from within your TableViewController using
self.displayDate, for example in yourtitleForHeaderInSection.