Here is the message:
[SQLiteDB addRecordToDatabase:(ZBarSymbol *)sym开发者_如何学编程bol]; // add this record to the d/b
Here is the definition of the message in the .h file:
- (void)addRecordToDatabase:(ZBarSymbol *)symbol ;
Here is the implementation of the message:
//--------------------- addRecordToDatabase ----------------------|
- (void)addRecordToDatabase: (ZBarSymbol *)symbol {
I get the following error during execution:
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'
What's wrong with it?
It is declared as instance method and used as class method. Class methods are declared with a "+" sign.
+ (void)addRecordToDatabase:(ZBarSymbol *)symbol;
This question discusses instance vs class methods.
精彩评论