is there a way to pass a boolean to the addClicked method beside using button.tag for the code below?
[cellview.buttonAdd addTarget:self action:@selector(addClicked:) forControlEvents:UIControlEventTouchUpInside];
-(void) addClicked:(id)sender {
}
THanks in advance.
Short answer: You cannot pass extra information into the method directly.
Why would you want to do that anyway though? What does the button “know” that it would need to communicate, other than the fact that it was clicked?
The way this should be done is via an instance variable in the class that implements the click handler.
If you really must maintain state inside the button itself, subclass it: