i've got simple if case in touchesBegan
method:
if ([touch.view isKindOfClass:[Direction class]])
{
//select tapped object and do something...
}
i've got on view many Direction
objects, and when i tap on one i want to select it, like:
Direction *d = [touch.view].selectedObject; //something like that.
Can i do this in obj-C? or how can i do this correctly?
if ([touch.view isKindOfClass:[Direction class]])
{
//do something...
Direction *d = (Direction*)[touch view];
}