收到错误线程1:EXC_BAD_ACCESS(代码= 1,地址= 0x20)

时间:2019-01-18 13:58:19

标签: ios objective-c exc-bad-access

此行Thread 1: EXC_BAD_ACCESS (code=1, address=0x20)上出现[target setAlpha:0.0f];错误

当我尝试使用指纹身份验证登录我的应用程序时,我的应用程序崩溃了。当我调试它时,我发现了这个问题

Thread 1: EXC_BAD_ACCESS (code=1, address=0x20).

这是我的代码:

- (void)blinkAnimation:(NSString *)animationID finished:(BOOL)finished target:(UIView *)target
{
    NSString *selectedSpeed = [[NSUserDefaults standardUserDefaults] stringForKey:@"EffectSpeed"];
    float speedFloat = (0.82 - [selectedSpeed floatValue]);

    [UIView beginAnimations:animationID context:(__bridge void *)(target)];
    [UIView setAnimationDuration:speedFloat];
    [UIView setAnimationDelegate:self];
    [UIView setAnimationDidStopSelector:@selector(blinkAnimation:finished:target:)];

    if([target alpha] == 1.0f)
        [target setAlpha:0.0f];
    else
        [target setAlpha:1.0f];
    [UIView commitAnimations];
}

0 个答案:

没有答案