从Objective-C中的实例获取类的名称 [英] Getting name of the class from an instance in Objective-C
本文介绍了从Objective-C中的实例获取类的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下问题:我得到一个类的实例传递,想知道这个实例的类的名称。
I have the following problem: I get an instance of a class passed and want to know the name of the class of this instance. Any guess how to get this?
推荐答案
p> NSStringFromClass([instance class])
应该做的。
这篇关于从Objective-C中的实例获取类的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文