hey guys been looking through a lot of info on the web but can't understand what i'm doing wrong:
my .h file:
my .m file:
using myClass:
the error i get:
010-01-26 20:59:36.540 myApp[6428:207] *** -[NSCFString setNumber:]: unrecognized selector sent to instance 0x405c
2010-01-26 20:59:36.542 myApp[6428:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFString setNumber:]: unrecognized selector sent to instance 0x405c'
any help or just pointing me in the right direction would be greatly appreciated
thanks
my .h file:
Code:
@interface myClass : NSObject {
NSString* colour;
}
- (NSString*) colour;
- (void) setColour:(NSString*)input;
@end
my .m file:
Code:
@implementation myClass
- (NSString*) colour {
return colour;
}
- (void) setColour: (NSString*)input {
colour = input;
}
- (void) dealloc
{
[colour release];
[super dealloc];
}
@end
using myClass:
Code:
myClass *test = [[myClass alloc] init];
[myClass setNumber:10];
the error i get:
010-01-26 20:59:36.540 myApp[6428:207] *** -[NSCFString setNumber:]: unrecognized selector sent to instance 0x405c
2010-01-26 20:59:36.542 myApp[6428:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFString setNumber:]: unrecognized selector sent to instance 0x405c'
any help or just pointing me in the right direction would be greatly appreciated