简体   繁体   English

未实现协议“ KalDataSource”中的方法“ markedDatesFrom”

[英]method “markedDatesFrom” in protocol “KalDataSource” not implemented ERROR

I am trying to display the Kal ( https://github.com/phaibin/Kal ) calendar but I am getting some errors. 我正在尝试显示Kal( https://github.com/phaibin/Kal )日历,但出现一些错误。

Here is the .h file: 这是.h文件:

#import <UIKit/UIKit.h>
#import "Kal.h"


@interface CalendarViewController : UITableViewController <UIApplicationDelegate,KalDataSource>

@property (nonatomic, retain) IBOutlet KalViewController *calendar;

@end

and my .m file: 和我的.m文件:

#import "CalendarViewController.h"
#import "Kal.h"

@interface CalendarViewController ()


@end

@implementation CalendarViewController

@synthesize calendar = _calendar;

    - (void)viewDidLoad {
        [super viewDidLoad];


        _calendar = [[KalViewController alloc] init];
        _calendar.delegate = self;
        _calendar.dataSource = self;
        [self.view addSubview:_calendar.view];
        [_calendar loadView];
}

I am getting the following errors: 我收到以下错误:

Method 'presentingDatesFrom:to:delegate:' in protocol 'KalDataSource' not implemented.
Method 'markedDatesFrom:to:' in protocol 'KalDataSource' not implemented.
Method 'loadItemsFromDate:toDate:' in protocol 'KalDataSource' not implemented.
Method 'removeAllItems' in protocol 'KalDataSource' not implemented.

Does anyone know how to fix these errors? 有谁知道如何解决这些错误? Thank you 谢谢

You have told the compiler that your CalendarViewController conforms to the KalDataSource protocol. 您已经告诉编译器您的CalendarViewController符合KalDataSource协议。 That means you must implement all the required methods defined in that protocol. 这意味着您必须实现该协议中定义的所有必需方法。 A quick look at the docs on github confirm that the protocol includes all the methods that you're getting warned about. 快速浏览一下github上的文档,确认该协议包含您所警告的所有方法。

The solution is to implement those methods in your CalendarViewController class. 解决方案是在CalendarViewController类中实现这些方法。 I've never heard of the Kal class, so I don't know the details of what that means. 我从未听说过Kal班,所以我不知道这意味着什么的细节。 It certainly means that you need to implement all the methods the compiler is complaining about. 当然,这意味着您需要实现编译器抱怨的所有方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM