Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Add Action listener

 
asif Bashir
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
{
img[i].addactionlistner('click',function(e){
//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
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are creating a native iOS app using JavaScript?

Any way, is the method you are using is correct or not? Try it!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic