出於某種原因,我不能讓這個表達式工作:Swift:如何在字符串表達式中打印字典鍵的值?
我如何輸出println
聲明?我得到錯誤
Unexpected "" character error in string interpolation
我該如何做到這一點?
出於某種原因,我不能讓這個表達式工作:Swift:如何在字符串表達式中打印字典鍵的值?
我如何輸出println
聲明?我得到錯誤
Unexpected "" character error in string interpolation
我該如何做到這一點?
在當前版本的Swift中,您必須首先將值放入其自己的常量/變量中,然後使用它。
if let employed : AnyObject = expandedBio["employed"] {
let t = expandedBio["name"]
println("\(t) is not available")
}
這個問題在swift中解決了2.1 – pabloa98