从 int 赋值给值
Assign toValue from an int
我正在制作动画,希望每次点击图像时 toValue 变大。我的代码可以工作(当然现在不行),但是如何使 toValue 成为整数?
我有这个:
int comboTapAnim = (comboTap / 10) + 1;
然后在动画中:
theAnimation.toValue = [comboTapAnim];
Xcode 不喜欢。我尝试过其他组合,但它必须是一个 NSNumber,但我希望它是一个 int。
我找到答案了!!
[NSNumber numberWithInt:<#(int)#>]
我正在制作动画,希望每次点击图像时 toValue 变大。我的代码可以工作(当然现在不行),但是如何使 toValue 成为整数?
我有这个:
int comboTapAnim = (comboTap / 10) + 1;
然后在动画中:
theAnimation.toValue = [comboTapAnim];
Xcode 不喜欢。我尝试过其他组合,但它必须是一个 NSNumber,但我希望它是一个 int。
我找到答案了!!
[NSNumber numberWithInt:<#(int)#>]