HomepwnerItemCell may not respond to setPossession


#1

I keep getting this error, I’ve checked over the code many times, and i’m not sure what’s going wrong.

the warning is at the line

[cell setPossession:p];

in ItemsViewController.m, and when I run the application i get an error "unrecognized selector sent to instance …"
and “terminating app due to uncaught exception 'NSInvalidArgumentException.”

Can someone tell me why this might be happening?

My HomepwnerItemCell header file looks like this:

#import <Foundation/Foundation.h>

@class Possession;

@interface HomepwnerItemCell : UITableViewCell
{
UILabel *valueLabel;
UILabel *nameLabel;
UIImageView *imageView;
}

  • (void)setPosession:(Possession *)possession;

@end

So it doesn’t make sense that i’m passing an invalid argument when i’m passing it a possession object.


#2

Looks like you have a typo in the method declaration in the header file:

  • (void)setPo[color=#FF0000]s[/color]ession:(Possession *)possession;

Also, double-check the spelling of the method name in the implementation (.m) file as that is the one which will eventually get called (or not get called if misspelled).