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)");
原文链接:https://www.f2er.com/swift/326864.htmlclass 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)");
原文链接:https://www.f2er.com/swift/326864.html