0
我有以下代碼的UIView的animateWithDuration:動畫:完成:錯誤
-(void) animate:(UIButton*) b withState: (int) state andLastState:(int) last_state {
if (state < last_state) {
int stateTemp = state;
float duration = 1.0/30.0;
[b animateWithDuration: duration
animations: ^{ [UIImage imageNamed:[NSString stringWithFormat:@"m1.a000%d.png", state]]; }
completion: ^{ animate(b, stateTemp++, last_state); }];
}
}
,但得到的錯誤增量只讀變量stateTemp
我試圖通過設置動畫的一系列圖像UIButton
s圖像。
這段代碼有什麼問題?