SpokaneDude
SpokaneDude

Reputation: 4984

What's wrong with this message?

Here is the message:

[SQLiteDB addRecordToDatabase:(ZBarSymbol *)symbol];  //  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?

Upvotes: 0

Views: 55

Answers (1)

albertamg
albertamg

Reputation: 28572

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.

Upvotes: 3

Related Questions