开发者

error: expected ':' before ')' token

开发者 https://www.devze.com 2023-03-06 04:19 出处:网络
-(void)countdown:(NSTimer *)timer{ _value -=1; if ((_delegate != nil) && [_delegate respondsToSelector:@selector(countdownTicker:didUpdateValue:withAction)]) { // error: expected \':\' before
-(void)countdown:(NSTimer *)timer{

    _value -=1;
    if ((_delegate != nil) && [_delegate respondsToSelector:@selector(countdownTicker:didUpdateValue:withAction)]) { // error: expected ':' before ')' token
        [_delegate countdownTicker:self didUpdateValue:_value withAction:ZIMCountdownTickerTickAction];
    }
    if (_value <= 0) {
 开发者_StackOverflow社区       [self stop];
        if ((_delegate != nil) && [_delegate respondsToSelector:@selector(countdownTicker:didUpdateValue:withAction)]) { // error: expected ':' before ')' token
            [_delegate countdownTickerDidFinish:self];
        }
    }
}


Fix it exactly as the error says:

... respondsToSelector:@selector(countdownTicker:didUpdateValue:withAction:)]
                                                                          ^


You need to put a ':' at the end of your withAction parameter in the selector.

0

精彩评论

暂无评论...
验证码 换一张
取 消