【发布时间】:2012-07-12 11:41:18
【问题描述】:
在我的webViewDidFinishLoad 方法中,我有以下代码:
- (void)webViewDidFinishLoad:(UIWebView *)webView {
if (hasPressed == 1) {
hasPressed = 0;
isBlocked = 0;
}
else if (hasPressed == 0 && hasDroppedDown == 0) {
if (viewState != kStateWeather || isBlocked == 0) {
[UIView animateWithDuration:0.5
delay:0.0 options:UIViewAnimationCurveLinear animations:^{
//Animations
}
completion:^(BOOL finished){
hasDroppedDown = 1;
}];
}
}
}
如您所见,如果此方法被快速调用,例如一个有重定向的网站,我的else if 中的else 变得无用。如何阻止它被如此迅速地调用?
【问题讨论】:
标签: iphone objective-c cocoa-touch sdk