Get all instances of a class in objective c?

前端 未结 4 1498
不思量自难忘°
不思量自难忘° 2021-01-15 11:58

I have a UIView that has many instances and each one of them has a UIRecognizer.

When on of them is tapped I want to remove all the recognizers of the others.

<
4条回答
  •  醉梦人生
    2021-01-15 12:13

    If you just need to find all instances for debugging purposes, you can use the Allocations instrument and change the Recorded Types to only your class. This will give you a dandy list of all your objects. You can then interact with them using lldb by using their address.

提交回复
热议问题