Error: KLCalendarView gives error while integrating it into an iPhone app
what does these two error means :
1. cannot find protocol declaration for 'KLCalendarViewDelegate'
2. Expected specifier-qualifier-list before 'KLCalendarView'
in this code:
#import <UIKit/UIKit.h>
#import "KLCalendarView.h"
#import "CheckmarkTile.h"
@interface CalendarTestViewController开发者_C百科 : UIViewController<KLCalendarViewDelegate>
{
KLCalendarView *calendarView;
KLTile *currentTile;
UITableView *myTableView;
NSMutableArray *tableViewData;
KLTile *tile;
BOOL shouldPushAnotherView;
}
@end
Below the import statements add the following statement:
@class KLCalendarView;
This would definitely solve your Error no. 2
If you have any doubts regarding this then leave a comment below.
Hope this helps you.
Your declaration of CalendarTestViewController says that it implements KLCalendarViewDelegate, but the compiler says it can't find the declaration for that protocol. The second error makes me think that there's a problem with the declaration of KLCalendarView in KLCalendarView.h, and it may be that's the reason the compiler doesn't see the delegate protocol. Take a careful look at KLCalendarView.h, particularly in the lines above the @interface KLCalendarView
line. You might find a missing semicolon, missing closing brace, spelling error, something like that.
You need to declare the protocol in your header which your current class will be implementing.
A protocol is a list of method declarations. If your class adopts the protocol,
then you have to implement those methods in your class.
So you can declare them as follows:
@protocol <name>
<methods>
@end
精彩评论