【问题标题】:Swift 3 - Thread 1: EXC_BAD_INSTRUCTION (code = EXC_I386_INVOP, subcode = 0x0)Swift 3 - 线程 1:EXC_BAD_INSTRUCTION(代码 = EXC_I386_INVOP,子代码 = 0x0)
【发布时间】:2017-04-20 15:22:34
【问题描述】:

我正在尝试使用 AWS Cognito 作为后端将用户身份验证功能添加到我的应用程序中。

到目前为止,每当我的应用程序尝试构建时,我都会收到此错误,并且当它指向我的两个类中的这些错误时。

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

【问题讨论】:

    标签: ios swift amazon-cognito aws-mobilehub amazon-mobile-hub


    【解决方案1】:

    看起来 AWS MobileHub 示例代码尚未与 swift3 兼容——这就是我所遇到的;也许你也是?请参阅 here 以获取来自 AWS 的答案,以及使用旧版编译器设置的提示(我还没有整理...)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-06-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多