开发者

What's wrong with this message?

开发者 https://www.devze.com 2023-03-02 15:13 出处:网络
Here is the message: [SQLiteDB addRecordToDatabase:(ZBarSymbol *)sym开发者_如何学编程bol];//add this record to the d/b

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消