swift显示变量的类名称
varivar=[:]ivar.className//__NSDictionaryIvari=1i.className//error:'Int'doesnothaveamembernamed'className'
If you want to get the type of a primitive, you have to usebridgeToObjectiveC()
. Example:
var i = 1
i.bridgeToObjectiveC().className // __NSCFNumber
println("\(object_getClassName(now))");
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。