Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 Objective-C 运行时库,我们如何确定一个对象是类对象而不是类的实例?
我所知道的最简单可靠的方法是class_isMetaClass(object_getClass(yourObject)). (这是因为类总是元类的实例。)
class_isMetaClass(object_getClass(yourObject))