課程
/移動開發
/iOS
/玩兒轉Swift
這么會有問題的,具體是什么情況
2019-07-28
源自:玩兒轉Swift 2-5
正在回答
let userInput = "18"
var age = Int(userInput)
if age != nil {
? ? print("Your age is + \(String(describing: age!))")
} else {
? ? print("invalid userInput")
}
} else if age == nil {
你的xcode,swift是啥版本的?報錯信息是說沒有 toInt這個成員(memeber),估計應該是因為你的swift版本低導致的
慕沐8480496 提問者
舉報
這套教程比任何的Swift中文教程深入,并且演示示例更豐富
3 回答提示無法找到String相關方法
2 回答這樣會報錯,求解決方法
4 回答【xcode編寫swift】老師為什么我用中文字符作為變量,后面的預覽沒有顯示出來?
11 回答countElements在最新版的語法中是不是改成count了???然后現在的count方法要怎么使用
1 回答為什么在每次調用時,totalmiles不會被置為0呢?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2019-08-15
let userInput = "18"
var age = Int(userInput)
if age != nil {
? ? print("Your age is + \(String(describing: age!))")
} else {
? ? print("invalid userInput")
}
2019-08-15
let userInput = "18"
var age = Int(userInput)
if age != nil {
? ? print("Your age is + \(String(describing: age!))")
} else if age == nil {
? ? print("invalid userInput")
}
2019-08-06
你的xcode,swift是啥版本的?報錯信息是說沒有 toInt這個成員(memeber),估計應該是因為你的swift版本低導致的