swift类名称显示变量

var ivar = [:]
ivar.className // __NSDictionaryI

var i = 1
i.className // error: 'Int' does not have a member named 'className'


 
    
If you want to get the type of a primitive, you have to use bridgeToObjectiveC(). Example:

var i = 1
i.bridgeToObjectiveC().className // __NSCFNumber






println("\(object_getClassName(now))");

版权声明:本文博主原创文章,博客,未经同意不得转载。

你可能感兴趣的:(swift类名称显示变量)