If you did not create an output and action for each button, then even obtaining sub-items and comparing with isKindofClass will not solve the problem. You will need to assign a tag value to each button, and you can send the sender to UIButton, and then define the tag and change the image to match the tag. If you want to change the image of the pressed button, you can simply change the image of the sender, since the pressed button is the last.
if(((UIButton *)sender).tag==intvalue) { ((UIButton *)sender) setImage:[UIImage imageNamed:@"Your Image"]]; }
in case of changing the image of the pressed button just change the image, it is not necessary if the part and tag.
source share