objective c - How to select object by touch.view and isKindOfClass? -


i've got simple if case in touchesbegan method:

if ([touch.view iskindofclass:[direction class]]) {     //select tapped object , something... } 

i've got on view many direction objects, , when tap on 1 want select it, like:

direction *d = [touch.view].selectedobject; //something that. 

can in obj-c? or how can correctly?

if ([touch.view iskindofclass:[direction class]]) {     //do something...     direction *d = (direction*)[touch view]; } 

Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

asp.net mvc - Implementing normal user/pass, Twitter & Facebook auth -