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