Objective c 错误:应为';:';在';之前)';代币 -(void)倒计时:(NSTimer*)计时器{ _值-=1; if((_delegate!=nil)&&&[_delegaterespondstoselector:@selector(countdownTicker:didUpdateValue:withAction)]{//错误:应为':'before')'标记 [\u委托countdownTicker:self-didUpdateValue:\u带操作的值:ZIMCountdownTickerTickAction]; } 如果(_值
按照错误所述进行修复:Objective c 错误:应为';:';在';之前)';代币 -(void)倒计时:(NSTimer*)计时器{ _值-=1; if((_delegate!=nil)&&&[_delegaterespondstoselector:@selector(countdownTicker:didUpdateValue:withAction)]{//错误:应为':'before')'标记 [\u委托countdownTicker:self-didUpdateValue:\u带操作的值:ZIMCountdownTickerTickAction]; } 如果(_值,objective-c,Objective C,按照错误所述进行修复: -(void)countdown:(NSTimer *)timer{ _value -=1; if ((_delegate != nil) && [_delegate respondsToSelector:@selector(countdownTicker:didUpdateValue:withAction)]) { // error: expected ':' before ')' token [_delegate co
-(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) {
[self stop];
if ((_delegate != nil) && [_delegate respondsToSelector:@selector(countdownTicker:didUpdateValue:withAction)]) { // error: expected ':' before ')' token
[_delegate countdownTickerDidFinish:self];
}
}
}
完全按照错误所述进行修复:
-(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) {
[self stop];
if ((_delegate != nil) && [_delegate respondsToSelector:@selector(countdownTicker:didUpdateValue:withAction)]) { // error: expected ':' before ')' token
[_delegate countdownTickerDidFinish:self];
}
}
}
你需要在选择器中的
with action
参数的末尾加一个“:”。你需要在选择器中的with action
参数的末尾加一个“:”。@sidyl和@MarkPowell:谢谢..照你说的做了,效果很好。然后别忘了把答案标记为正确…@sidyl和@MarkPowell:谢谢s、 .照你说的做了,很有效。非常感谢。然后别忘了把答案标为正确…