Let me first say I didn't write this code; it was from the Calendar API written by tinyFool in 2010. As such, it did what it was supposed to do before Apple deprecated CFGregorianDate; now, I'm trying to convert it to the recommended NSCalendar. If you need more relevant code that I haven't supplied, let me know and I'll post it.
I have two statements that appear in several places:
[calendarViewDelegate monthChanged: currentMonthDate viewLeftTop:self.frame.origin height:height];
[calendarViewDelegate beforeMonthChange:self willto: currentMonthDate];
which are giving me the following warning:
Incompatible pointer types sending 'NSDate *' to parameter of type 'NSCalendar *'
This is the delegate definition:
@protocol CalendarViewDelegate <NSObject>
@optional
- (void) selectDateChanged:(NSCalendar *) selectDate;
- (void) monthChanged:(NSCalendar *) currentMonth viewLeftTop:(CGPoint)viewLeftTop height:(float)height;
- (void) beforeMonthChange:(CalendarView *) calendarView willto:(NSCalendar *) currentMonth;
@end
Delegates are one of my weak points; for some reason I can't seem to understand them, although I understand what their purpose is. When I look in my code for monthChanged, I find nothing! So my question is: why is the author using this code if it doesn't do anything? And how do I change the code to remove the warning, which is affecting the correct operation of the affected methods?