我目前正在使用 aUIImageView
根据用户按下的按钮为一系列图像设置动画。我在 中创建了大约 5 组不同的图像,NSArrays
例如:
-(void)initiateAnimations {
punchani = [NSArray arrayWithObjects:
[UIImage imageNamed:@"punch0001.png"],
[UIImage imageNamed:@"punch0002.png"],
[UIImage imageNamed:@"punch0003.png"],
[UIImage imageNamed:@"punch0004.png"],
[UIImage imageNamed:@"punch0005.png"],
[UIImage imageNamed:@"punch0006.png"],
[UIImage imageNamed:@"punch0007.png"],
[UIImage imageNamed:@"punch0008.png"],
[UIImage imageNamed:@"punch0009.png"],
[UIImage imageNamed:@"punch0010.png"],
[UIImage imageNamed:@"punch0011.png"],
[UIImage imageNamed:@"punch0012.png"],nil];
}
然后我使用标准动画代码将它们循环一次:
player.animationImages = punchani;
player.animationDuration = 0.50;
player.animationRepeatCount = 1;
[player startAnimating];
但是,当我将越来越多/不同的图像加载到UIImageView
.
2013-03-15 20:52:23.065 AppName[2080:907] Received memory warning.
我知道这可能会发生,但 ARC 禁止我释放这些数组。我该如何解决这个泄漏?谢谢