First, you get contact with:
UITouch *touch = [[event allTouches] anyObject];
Next, you want to check the location of the InView relative to your image.
CGPoint location = [touch locationInView:self]; // or possibly myimage instead of self.
Next, CGRectContainsPoint returns a boolean, so comparing it to 0 is very odd. It should be:
if ( CGRectContainsPoint( myimage.frame, location ) ) { // inside } else { // outside }
But if I'm not myimage, then the myimage view can get a touch for you - it is not clear from your question what the object itself is, it is not a subclass of the UIImageView in question.
source share