method "markedDatesFrom" in protocol "KalDataSource" not implemented ERROR

72 Views Asked by At

I am trying to display the Kal (https://github.com/phaibin/Kal) calendar but I am getting some errors.

Here is the .h file:

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


@interface CalendarViewController : UITableViewController <UIApplicationDelegate,KalDataSource>

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

@end

and my .m file:

#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

1

There are 1 best solutions below

1
On

You have told the compiler that your CalendarViewController conforms to the KalDataSource protocol. 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.

The solution is to implement those methods in your CalendarViewController class. I've never heard of the Kal class, so I don't know the details of what that means. It certainly means that you need to implement all the methods the compiler is complaining about.