my dog learned polymorphism
The moose likes iOS and the fly likes Add Action listener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Mobile » iOS
Bookmark "Add Action listener " Watch "Add Action listener " New topic

Add Action listener

asif Bashir

Joined: May 14, 2013
Posts: 1
I am creating an App for iPhone using JavaScript. I have an array of images, let say img[] ,and a place all these images on screen i want to add action listener to each image. Each image has to perform different functionality. I am using this method

for(var i=0;i<img.length)
//Print the index of image clicked

This method add action listener to images.Please tell me that this method is right or not. If yes then how can i identify that which image is clicked(it should tell me the index).
Hussein Baghdadi
clojure forum advocate

Joined: Nov 08, 2003
Posts: 3479

You are creating a native iOS app using JavaScript?

Any way, is the method you are using is correct or not? Try it!
I agree. Here's the link:
subject: Add Action listener
It's not a secret anymore!