Xcode 从整数赋值

Xcode 从整数赋值,xcode,integer,cabasicanimation,Xcode,Integer,Cabasicanimation,我正在制作一个动画,希望每次点击图像时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)#>]
[NSNumber numberwhithint:]