I am sure that you cannot compare a string with an image. However, there is a solution. All you have to do is set the tag for the image you want to compare and set the tag for the image you are comparing.
image1.tag = 1; image.tag =1; if(image1.tag == image.tag) {
which should help, and I hope he does.
SO, for this exercise I will show you. Change NSString to UIImage
UIImage *currentImage = [sender imageForState:UIControlStateNormal]; currentImage.tag = 1; wantedImage.tag = 1; if(currentImage.tag == wantedImage.tag) {
hope this helps you :)
source share