This is the method from Tapku and I want to call it from the controller
- (NSDate*) dateSelected{
if(selectedDay < 1 || selectedPortion != 1) return nil;
TKDateInformation info = [monthDate dateInformationWithTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
info.hour = 0;
info.minute = 0;
info.second = 0;
info.day = selectedDay;
NSDate *d = [NSDate dateFromDateInformation:info timeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
return d;
}
And I'm trying to call it like this and convert it to string format.
TKCalendarMonthView *tk=[[TKCalendarMonthView alloc] init];
NSDate *date=tk.dateSelected;// How can I call it?With the debug it shows it's null.
NSDateFormatter *selectedDate=[[NSDateFormatter alloc] init];
[selectedDate setDateFormat:@"yyyy-MM-dd"];
NSMutableString *stringDate=[NSMutableString stringWithFormat:@"%@",[selectedDate stringFromDate: date]]`
Makes it a function call (strictly speaking, send the object a message). Dot syntax is for getters/setters only. I strongly suggest reading upon objc basic first.