我在 for 循环中循环 uibuttons 对象进行一些计数,当我必须释放对象时,不幸的是我应该使用非 ARC 应用程序
这是我所做的代码
for (UIButton *btn in [self.locationScrollView subviews])
{
if ([btn tag]==1)
[btn setBackgroundImage:[UIImage imageNamed:@"whiteLeft.png"] forState:UIControlStateNormal];
else if ([btn tag]==8)
[btn setBackgroundImage:[UIImage imageNamed:@"whiteright.png"] forState:UIControlStateNormal];
else
[btn setBackgroundImage:[UIImage imageNamed:@"whitemid.png"] forState:UIControlStateNormal];
}