I am trying to check some UIButton images to see if they are certain images. If they are, I want to set an NSString to a value but the value is always null. What am I doing wrong?
if ([self.firstButton.currentImage isEqual:[UIImage imageNamed:@"image"]]
&& [self.secondButton.currentImage isEqual:[UIImage imageNamed:@"another_image"]]
&& [self.thirdButton.currentImage isEqual:[UIImage imageNamed:@"another_image"]]
&& [self.fourthButton.currentImage isEqual:[UIImage imageNamed:@"another_image"]]
&& [self.fifthButton.currentImage isEqual:[UIImage imageNamed:@"another_image"]]) {
self.myString = @"some string";
}
NSLog(@"My String: %@", self.myString);
You can do like this
Try this one. This may help.