I’m trying to add an event to a UIbutton:
UIButton *btn = [[UIButton alloc] init];
[btn setBackgroundImage:[UIImage imageNamed:@"aa.png"]
forState:UIControlStateNormal];
[btn addTarget:self
action:@selector(Presed:)];
and I’m getting this warning :
"UIButtom may not respond to addTarget:action"
The interface I’m creating this button for inherits from CDVPlugin
what’s wrong with my code?
you are calling a method that is not declared.
it should be.
– addTarget:action:forControlEvents: