I created a custom UIButton like this
@interface CustomButton : UIButton {
NSString *firstLine;
NSString *secondLine;
}
@property (nonatomic, retain) NSString *firstLine;
@property (nonatomic, retain) NSString *secondLine;
@end
CustomButton* rightButton = [CustomButton buttonWithType:UIButtonTypeDetailDisclosure];
rightButton.secondLine=@"hello";
error message is:
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[UIButton setSecondLine:]: unrecognized selector sent to instance 0x43280e0'
What has to be done to fix this up? how should the instance variable added?