i have several UIImageView, each of them has a tag; and I have an array of Images, what i want to do is: when user tap one of the UIImageView, the app give back the certain
Instead of using a UIImageView why don't you use an UIButton. That way you can simply add a listener for UITouchDown events. You can tag each button so that in your touchDown method you can find which button was pressed.
UIButton *button = [[UIImageView alloc] initWithFrame:CGRectMake(10, i*100 + i*15, 300, 100)];
button.backgroundColor = [UIColor blueColor];
button.tag = i;
[button addTarget:self action:@selector(touchDown:) controlEvent:UIControlEventTouchDown];
And inside of the touchDown: method you simply have to cast the sender to a UIButton in order to access the tag.
- (void)touchDown:(id)sender
{
UIButton* button = (UIButton*)sender;
switch(button.tag)
{
case TAG1:
break;
//etc
}
}