[英]Method in protocol not implemented correctly
我正在使用Tapku庫在我的視圖中添加日歷。 我遇到語義問題
calendarMonthView:marksFromDate:toDate:'未實現協議'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實現錯誤?
謝謝!
確保您的視圖控制器符合數據源協議:
viewcontroller.h:
@interface ViewController : UIViewController<TKCalendarMonthViewDataSource>
..並在viewcontroller.m中實現calendarMonthView:marksFromDate:toDate
方法
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.