Iphone 错误:忽略了参数名
我正在尝试制作一个自动反转动画,并且在“completion:^(BOOL)finished{”行中得到了上面的错误 注意:我第一次尝试使用下面的代码,但是按钮在动画结束时跳到了新位置Iphone 错误:忽略了参数名,iphone,objective-c,core-animation,Iphone,Objective C,Core Animation,我正在尝试制作一个自动反转动画,并且在“completion:^(BOOL)finished{”行中得到了上面的错误 注意:我第一次尝试使用下面的代码,但是按钮在动画结束时跳到了新位置 [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.5]; [UIView setAnimationRepeatAutoreverses:YES]; [bu
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationRepeatAutoreverses:YES];
[button setTransform:CGAffineTransformMakeTranslation(0, 200)];
[UIView commitAnimations];
finished
是BOOL
参数的名称,并且Objective-C块具有C风格的函数签名,因此必须在括号中
块的签名应该如下所示:
^(BOOL finished) {
}
^(BOOL finished) {
}