When the method that I am trying to link to my UIButton only has one parameter, then I am able to call addTarget and my code runs successfully when the button is clicked —
[ myDetailButton addTarget:self action:@selector(hideMap:) forControlEvents:UIControlEventTouchUpInside];
(void)hideMap:(NSMutableArray*)arguments
but if I add a second parameter to my hideMap method, I get an unrecognized selector error when calling it:
[ myDetailButton addTarget:self action:@selector(hideMap:) forControlEvents:UIControlEventTouchUpInside];
(void)hideMap:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
I see this error no matter how I format the addTarget parameters, per this question —
action:@selector(hideMap)
action:@selector(hideMap:)
action:@selector(hideMap:event:)
How can I call a method that has multiple parameters using addTarget?
You’re problem is you are giving a selector that is expecting an NSMutableArray as the input along with a dictionary. the UIButton does not agree with this. As per your post you linked to, a UIBUtton only agrees to sending either nothing, itself as an id, or itself and an event.
I’m not 100% sure how you are expecting to get an NSMutableArray and an NSMutableDictionary from a UIButton callback, what is it exactly you are trying to achieve here, I might be able to suggest some help.