2
我正在尝试将使用AWS Cognito作为后端的用户身份验证功能添加到我的应用程序中。Swift 3 - 线程1:EXC_BAD_INSTRUCTION(代码= EXC_I386_INVOP,子代码= 0x0)
到目前为止,每当我的应用程序尝试构建时,都会收到此错误,以及何时它会指向两个类中的这些错误。
AWSMobileClient类:
func didFinishLaunching(application: UIApplication, withOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
print("didFinishLaunching:")
let didFinishLaunching = AWSIdentityManager.defaultIdentityManager().interceptApplication(application, didFinishLaunchingWithOptions: launchOptions)
if (!isInitialized) {
AWSIdentityManager.defaultIdentityManager().resumeSession(completionHandler: {(_ result: AnyObject, _ error: Error) -> Void in
print("result = \(result), error = \(error)")
} as! (Any?, Error?) -> Void) --> ERROR ON THIS LINE <--
isInitialized = true
}
return didFinishLaunching
}
AppDelegate类:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return AWSMobileClient.sharedInstance.didFinishLaunching(application: application, withOptions: launchOptions as [NSObject : AnyObject]?) --> ERROR ON THIS LINE <--