2011-05-04 92 views
0

這裏是信息:這條信息有什麼問題?

[SQLiteDB addRecordToDatabase:(ZBarSymbol *)symbol]; // add this record to the d/b 

下面是在.h文件中的消息的定義:

- (void)addRecordToDatabase:(ZBarSymbol *)symbol ; 

以下是消息的實現:

//--------------------- addRecordToDatabase ----------------------| 
- (void)addRecordToDatabase: (ZBarSymbol *)symbol { 

我執行過程中出現以下錯誤:

2011-05-04 07:07:32.518 PointPeek[208:707] +[SQLiteDB addRecordToDatabase:]: unrecognized selector sent to class 0x276b8 
2011-05-04 07:07:32.574 PointPeek[208:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[SQLiteDB addRecordToDatabase:]: unrecognized selector sent to class 0x276b8' 

它有什麼問題?

回答

3

它被聲明爲實例方法並用作類方法。類方法用「+」號聲明。

+ (void)addRecordToDatabase:(ZBarSymbol *)symbol; 

This question討論了實例vs類的方法。

+0

我現在看到了......謝謝......修正了它 – SpokaneDude 2011-05-04 14:25:08

+0

@斯波坎老兄歡迎:) – albertamg 2011-05-04 14:26:45