How do I test which class an object is in Objective-C?

前端 未结 6 1192

How do I test whether an object is an instance of a particular class in Objective-C? Let\'s say I want to see if object a is an instance of class b, or class c, how do I go

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-30 17:14

    You can also check run time. Put one breakpoint in code and inside (lldb) console write

    (lldb) po [yourObject class]
    

    Like this..

提交回复
热议问题