First, since this list is more geared toward iPhone Web development,
you might also consider joining this list:

http://lists.ranchero.com/listinfo.cgi/iphonedev-ranchero.com

Now, to answer your questions:

1. By default UIImageViews do NOT support user interaction, so you are
correct in that you must call setUserInteractionEnabled:YES for each
one.

2. When you do that, then the touchesBegan... and touchesEnded...
methods will be called on the **UIImageView**, NOT your view
controller. If you want to provide code to handle the touches, you
must create your own subclass of UIImageView and implement those
methods on that class.

3. Instead of using UIImageViews, you might consider making them
UIButtons instead. Use a custom button type and set the image for the
normal state of the button. Then call
addTarget:action:forControlEvents: on the button to register an action
method in your view controller to handle the touches.

Chris

On Oct 9, 4:42 pm, iDVB <[EMAIL PROTECTED]> wrote:
> Ok, So am about to put my head threw a window....LOL.
> I've tried EVERYTHING (except what works I guess) to get this to work
> with ZERO luck.
>
> I have a grid of UIImageViews that contain UIImages and I want to
> detect touches on each UIImageView.
>
> in my ViewController I addSubview the UIImageViews to the
> UIScrollView.
>
> I've added the following to my ViewController
>
> // Handles the end of a touch event.
> - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
> {
>         NSLog(@"touch");
>
> }
>
> I've tried setting the setUserInteractionEnabled on all UImageViews to
> YES and NO and neither works.
>
> WHY! :(
>
> Can Anyone shed some light into this issue?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to