Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/94.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.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
Ios 移除并消除动画中使用的对象赢得';t零_Ios_Objective C_Swift - Fatal编程技术网

Ios 移除并消除动画中使用的对象赢得';t零

Ios 移除并消除动画中使用的对象赢得';t零,ios,objective-c,swift,Ios,Objective C,Swift,使用Obj-c连续地为alpha设置动画,但是当我尝试为空并删除子视图时,它会粘住,并且不会删除或停止设置动画 -(void)flashFingerPrint{ [UIView animateKeyframesWithDuration:1 delay:0 options:UIViewAnimationOptionRepeat|UIViewAnimationOptionAutoreverse|UIViewAnimationCurveEaseInOut animations:^{

使用Obj-c连续地为alpha设置动画,但是当我尝试为空并删除子视图时,它会粘住,并且不会删除或停止设置动画

-(void)flashFingerPrint{
    [UIView animateKeyframesWithDuration:1 delay:0 options:UIViewAnimationOptionRepeat|UIViewAnimationOptionAutoreverse|UIViewAnimationCurveEaseInOut animations:^{
         self.purpleFingerPrint.alpha = 0;
    } completion:^(BOOL finished) {
        nil;
    }];
}



-(void)hidePurpleHelper {

    if(nil != self.purpleFingerPrint && nil != self.purpleFingerPrint) {

        // add it to the screen with animation
        [UIView animateWithDuration:0.5 delay:0.2 options:(UIViewAnimationCurveEaseOut) animations:^{
            self.purpleHelperView.alpha = 0;
            self.purpleFingerPrint.alpha = 0;
            self.purpleFingerPrint = nil;
            [self.view willRemoveSubview:self.purpleFingerPrint];

        } completion:^(BOOL finished) {
            // nothing
            self.purpleHelperView = nil;
            self.purpleFingerPrint = nil;
            [self.view willRemoveSubview:self.purpleFingerPrint];
        }];
    }
}
我调用了隐藏功能,但指纹仍显示在屏幕上并仍在闪烁?

您需要

[self.purpleFingerPrint removeFromSuperview];
你需要

[self.purpleFingerPrint removeFromSuperview];

无需在此处重复检查
if(nil!=self.purpleFingerPrint&&nil!=self.purpleFingerPrint)
无需在此处重复检查
if(nil!=self.purpleFingerPrint&&nil!=self.purpleFingerPrint)