你好,我的xcode没有在侧边栏或结果区域显示任何东西突然它开始显示,我写了一小段代码并得到这个错误"致命错误:尝试评估编辑器占位符:file MyPlayground.playground"
以下是我的代码
//: Playground - noun: a place where people can play
import UIKit
import PlaygroundSupport
func calcBmi(weight : Double, height : Double) -> Double{
let BMI = weight/pow(height,2)
return BMI
}
var bmiResutl = calcBmi(weight: 60, height: 1.83)
print(bmiResutl)
答案 0 :(得分:0)
尝试重新加载您的文件,看看它是否适合您。 (关闭xCode并重新加载文件)
答案 1 :(得分:0)
使用您的代码在我的结尾提供了这个结果: enter image description here