废话不多说,直接上代码: xxx * xx=[[xxx alloc] init]; [NSString stringWithUTF8String:object_getClassName(xx)]; 我们可以通过上述语句获取这个对象的所属类名。