有LocalAuthentication和支持的iOS的使用问题7.0导入LocalAuthentification.framework在iOS 7.1崩溃
当我试图
import LocalAuthentication
我越来越崩溃,如果目标IOS版本少比8.0。
我试图以纪念LocalAuthentication.framework为在构建阶段可选和检查级别的可用性致电:
var isTouchIDSupported: Bool {
if let contextClass: AnyClass = NSClassFromString("LAContext") {
return LAContext().canEvaluatePolicy(.DeviceOwnerAuthenticationWithBiometrics, error: nil)
}
return false
}
如果我评论LAContext()字符串喜欢不死机:
var isTouchIDSupported: Bool {
if let contextClass: AnyClass = NSClassFromString("LAContext") {
//return LAContext().canEvaluatePolicy(.DeviceOwnerAuthenticationWithBiometrics, error: nil)
}
return false
}
如果我在我的代码的任何位置访问LA类(例如LAContext)的任何地方,它会在第一秒钟启动应用程序。我在这里做错了什么?
控制台日志此崩溃:
dyld: Symbol not found: _objc_isAuto
Referenced from: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/usr/lib/libobjc.A.dylib
in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
你使用Swift吗?那么你可能需要创建一个桥头文件并将其导入到那里。 – user965972 2014-10-17 14:06:54
选定的答案并未真正解决您的问题。你可以请张贴包含解决方案的实际答案。我也遭受同样的问题。 – harshitgupta 2014-10-27 16:06:25
我遇到了同样的问题,并将“自动链接框架”更改为NO。它没有解决问题。你能修复它吗? – DavidLiu 2014-10-27 18:54:17