出于某种原因,我无法在Swift中使用可选项。它们似乎总是nil。要么某处有错误,要么我不明白可选值是如何工作的。这是我正在做的:首先,我打开一个SwiftREPL:/Applications/Xcode6-Beta2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift这是我在REPL中输入的内容(结合返回值):1>varperhapsInt:Int?perhapsInt:Int?=nil2>perhapsInt=13>ifletactualInt=perhapsInt{4.println("