我该怎么做才能解决错误"线程1:信号SIGABRT"?

时间:2016-12-30 01:15:13

标签: swift3 ios10 dropbox-api xcode8-beta2 swiftydropbox

我跟随this tutorial on Github尝试学习如何使用SwiftyDropbox,但我遇到了这个错误

import UIKit
import SwiftyDropbox

@UIApplicationMain
  
    

class AppDelegate:UIResponder,UIApplicationDelegate {//主题1:信号SIGABRT

  
    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        DropboxClientsManager.setupWithAppKey("qcvovib4h1mn0zd")
        return true
    }

这是我在输出框中获得的内容

2016-12-29 15:41:23.576964 GaethrExample[1164:292818] -[GaethrExample.ViewController launchDropbox:]: unrecognized selector sent to instance 0x102809370
2016-12-29 15:41:23.583475 GaethrExample[1164:292818] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[GaethrExample.ViewController launchDropbox:]: unrecognized selector sent to instance 0x102809370'
*** First throw call stack:
(0x18b6a61c0 0x18a0e055c 0x18b6ad278 0x18b6aa278 0x18b5a459c 0x191536484 0x191536404 0x1915208b8 0x191535cf0 0x191535818 0x191530a60 0x19150152c 0x19f54953c 0x191ceea54 0x191ce84bc 0x18b654278 0x18b653bc0 0x18b6517c0 0x18b580048 0x18d006198 0x19156c2fc 0x191567034 0x1000d5b58 0x18a5645b8)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

这是我的ViewController代码

import UIKit
import SwiftyDropbox


class ViewController: UIViewController {
    @IBOutlet weak var launchDropbox: UIButton!

    @IBAction func launchDropboxPressed(_ sender: Any) {
        DropboxClientsManager.authorizeFromController(UIApplication.shared, controller: self,
                                                      openURL: { (url: URL) -> Void in
                                                        UIApplication.shared.openURL(url)
        })
    }

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }



}

我需要做些什么才能解决错误?

0 个答案:

没有答案