Swift3 我能做些什么来修复错误;线程1:信号SIGABRT“;?
我下面尝试学习如何使用SwiftHydroPBOX,但我遇到了这个错误Swift3 我能做些什么来修复错误;线程1:信号SIGABRT“;?,swift3,ios10,dropbox-api,xcode8-beta2,swiftydropbox,Swift3,Ios10,Dropbox Api,Xcode8 Beta2,Swiftydropbox,我下面尝试学习如何使用SwiftHydroPBOX,但我遇到了这个错误 import UIKit import SwiftyDropbox @UIApplicationMain 类AppDelegate:UIResponder,UIApplicationLegate{//线程1:信号SIGABRT 这是我在输出框中得到的 2016-12-29 15:41:23.576964 GaethrExample[1164:292818] -[GaethrExample.ViewController l
import UIKit
import SwiftyDropbox
@UIApplicationMain
类AppDelegate:UIResponder,UIApplicationLegate{//线程1:信号SIGABRT
这是我在输出框中得到的
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.
}
}
我需要做些什么来修复错误?这是您得到的全部错误/输出吗?我想您会得到更多,所以请分享您得到的任何其他信息,例如在输出控制台中。@Greg我添加了输出。感谢您的帮助!错误表明您的
ViewController
对象没有launchDropbox:代码>方法。您可以显示一些有关您在何处定义该方法或在何处调用该方法的详细信息吗?@PhillipMills我添加了ViewController代码从按钮检查您的连接。它是否指向launchDropboxPressed
(应该是)?有人认为它应该像调用函数一样调用您的outlet。这是您得到的全部错误/输出吗?我想您会得到更多,所以请分享您得到的任何其他内容,例如,在输出控制台中。@Greg我添加了输出。感谢您的帮助!错误表明您的ViewController
对象不可用保存一个launchDropbox:
方法。您能显示一些关于您在何处定义该方法或在何处调用该方法的详细信息吗?@PhillipMills我添加了ViewController代码从按钮检查您的连接。它是否指向launchDropboxPressed
(应该是)?有些人认为它应该像调用函数一样调用您的插座。
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.
}
}