我的代码看起来像这样:
let duration = funcThatReturnsAnOptionalNSTimeInterval()
let time = duration ?? otherFuncThatReturnsNSTimeInterval()
这给了我错误:
二元运算符'??'不能应用于'NSTimeInterval'类型的操作数?和'NSTimeInterval'
嗯......是不是完全 ??
运算符可以应用于什么?
我在这里错过了什么吗?
答案 0 :(得分:1)
您的问题可能在其他地方。运行得很好:
this
或许发布更多周围的代码?