2017-03-02 59 views
1

在代碼投LAError EXC_BAD_ACCESS在iOS8上

var error: NSError? 
if context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) == false, let error = error { 
    let error = error as? LAError else { 
    return .failure 
    } 
} 

我已經過線崩潰EXC_BAD_ACCESS僅適用於iPhone 5 iOS8上

let error = error as? LAError else 

回答

0

使用此代碼來解決這個問題:

var error: NSError? 
if context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) == false, let error = error { 
    let error = LAError(_nsError: error) 
}