我有简单的 if case intouchesBegan
方法:
if ([touch.view isKindOfClass:[Direction class]])
{
//select tapped object and do something...
}
我已经查看了许多Direction
对象,当我点击一个我想选择它时,例如:
Direction *d = [touch.view].selectedObject; //something like that.
我可以在 obj-C 中做到这一点吗?或者我怎样才能正确地做到这一点?