class ca{
var num:Int =1;
}
class cb{
var a:ca?;
}
class cc{
var b:cb?;
}
var x:cc =cc();
var y:Int? =x.b?.a?.num;//或var y = x.b?.a?.num;
println("y =\(y),\r\ny type =\(y.dynamicType)");
原文地址:http://blog.csdn.net/crazyeveryday/article/details/46581129