In a view controller in a storyboard I have a simple view which has a subview image with tag 0 and a subview label with tag 1.
I'm trying to get the image like this:
UIImageView *myImage = (UIImageView*)[myView viewWithTag:0];
But when I do this:
myImage.highlighted = YES;
I get this:
-[UIView setHighlighted:]: unrecognized selector sent to instance
It is clearly a UIImageView in the storyboard. Why would this cast not work?
Because of [myView viewWithTag:0]
which is the tag number for the main view as well
UIImageView
object a tag of, say, 100
(UIImageView*)[myView viewWithTag:100]