Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 错误:忽略了参数名_Iphone_Objective C_Core Animation - Fatal编程技术网

Iphone 错误:忽略了参数名

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

我正在尝试制作一个自动反转动画,并且在“completion:^(BOOL)finished{”行中得到了上面的错误

注意:我第一次尝试使用下面的代码,但是按钮在动画结束时跳到了新位置

        [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) {
}