2011-03-25 53 views
0

什麼呢這兩種錯誤是指:錯誤:KLCalendarView給出錯誤而將其集成到一個iPhone應用程序

找不到「KLCalendarViewDelegate」

2.預計符限定符協議聲明-list 'KLCalendarView'

在此代碼

前:

#import <UIKit/UIKit.h> 
#import "KLCalendarView.h" 
#import "CheckmarkTile.h" 

@interface CalendarTestViewController : UIViewController<KLCalendarViewDelegate> 
{ 
    KLCalendarView *calendarView; 
    KLTile *currentTile; 
    UITableView *myTableView; 
    NSMutableArray *tableViewData; 
    KLTile *tile; 
    BOOL shouldPushAnotherView; 

} 

@end 
+0

「在iPhone應用程序錯誤」不會幫助任何人發現這個職位的未來。編輯它可以更好地描述問題。 – 2011-03-25 06:14:27

回答

0

您的CalendarTestViewController聲明說它實現了KLCalendarViewDelegate,但編譯器說它找不到該協議的聲明。第二個錯誤讓我覺得在KLCalendarView.h中聲明KLCalendarView存在問題,這可能是編譯器沒有看到委託協議的原因。仔細看看KLCalendarView.h,特別是在@interface KLCalendarView行上面的行。您可能會發現缺少分號,缺少右大括號,拼寫錯誤等。

1

下面的import語句添加以下語句:

@class KLCalendarView; 

這肯定會解決你的錯誤沒有。 2

如果您對此有任何疑問,請在下面留言。

希望這可以幫助你。

+0

非常感謝!但它解決第一個錯誤不是第二個。 – 2011-03-25 06:11:19

+0

嘿,你嘗試'清潔',然後'建立和去'?我認爲這應該可以解決它。 – 2011-03-25 06:20:44

+0

嘿,那麼解決你的錯誤?還是仍然錯誤2nd沒有解決? – 2011-03-25 06:28:50

0

你需要在頭文件中聲明你的當前類將要實現的協議。

A protocol is a list of method declarations. If your class adopts the protocol, 
then you have to implement those methods in your class. 

所以,你可以聲明如下這些:

@protocol <name> 
<methods> 
@end 
相關問題