协议中的方法未正确实现

时间:2015-01-04 18:56:52

标签: ios objective-c tapku

我正在使用Tapku库在我的视图中添加日历。我遇到了语义问题

calendarMonthView:marksFromDate:toDate:'in protocol'TKCalendarMonthViewDataSource'未实现

在线

  @implementation ViewController

在我的视图controller.m

我尝试在TKCalendarMonthViewDataSource下实现calendarMonthView:marksFromDate:toDate:但是它成功编译然后关闭。

这是我尝试在TKCalendarMonthView.h中实现它的代码

@protocol TKCalendarMonthViewDataSource <NSObject>

- calendarMonthView:marksFromDate:toDate;


/** A data source that will correspond to marks for the calendar month grid for a particular     month.
 @param monthView The calendar month grid.
 @param startDate The first date shown by the calendar month grid.
 @param lastDate The last date shown by the calendar month grid.
 @return Returns an array of NSNumber objects corresponding the number of days specified in the     start and last day parameters. Each NSNumber variable will give a BOOL value that will be used to     display a dot under the day.
 */


- (NSArray*) calendarMonthView:(TKCalendarMonthView*)monthView marksFromDate:(NSDate*)startDate toDate:(NSDate*)lastDate;


@end

知道如何解决这个问题,还是我对calendarMonthView的实现:marksFromDate:toDate错误?

谢谢!

1 个答案:

答案 0 :(得分:0)

确保您的视图控制器符合数据源协议:

viewcontroller.h:

@interface ViewController : UIViewController<TKCalendarMonthViewDataSource>

..并在viewcontroller.m

中实现calendarMonthView:marksFromDate:toDate方法