小编Bri*_*ian的帖子

快速循环功能。无法调用非函数类型“Int”的值

我遇到了一个奇怪的问题..我尝试在我的一个视图控制器中调用 round 函数。

let roundedValue = round( letterAmount[ index ] * 10 ) / 10
Run Code Online (Sandbox Code Playgroud)

它工作得很好..当我尝试在另一个视图控制器中使用同一行的 round 时。

let roundedValue = round( letterAmount[ index ] * 10 ) / 10
Run Code Online (Sandbox Code Playgroud)

我收到错误无法调用非函数类型“Int”的值。

我也尝试做一条简单的线

round( 1.2 )
Run Code Online (Sandbox Code Playgroud)

同样的事情发生了,在一个视图控制器中我没有收到错误,但在另一个视图控制器中我收到错误 Cannot call value of non-function type 'Int'.. 为什么会发生这种情况?

int rounding swift

0
推荐指数
1
解决办法
2345
查看次数

标签 统计

int ×1

rounding ×1

swift ×1