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 <--