Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift showBluetoothAccessoryPicker不';t显示在屏幕上_Swift_Bluetooth - Fatal编程技术网

Swift showBluetoothAccessoryPicker不';t显示在屏幕上

Swift showBluetoothAccessoryPicker不';t显示在屏幕上,swift,bluetooth,Swift,Bluetooth,我的代码 调试控制台 override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. view.backgroundColor = .white view.addSubview(connectBtn) connectBtn.centerYAnchor.constraint(equalTo: view.centerYAnc

我的代码

调试控制台

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view.
    view.backgroundColor = .white
    view.addSubview(connectBtn)
    connectBtn.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
    connectBtn.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
    connectBtn.heightAnchor.constraint(equalToConstant: 30).isActive = true
    connectBtn.widthAnchor.constraint(equalToConstant: 100).isActive = true
    connectBtn.addTarget(self, action: #selector(showAccessoryPicker), for: .touchUpInside)
}

@objc func showAccessoryPicker() {
    EAAccessoryManager.shared().showBluetoothAccessoryPicker(withNameFilter: nil, completion: nil)
}
我使用官方SDK连接,工作正常

2020-07-21 15:26:40.674865+0800 StarPrnt[22299:6727201] A constraint factory method was 
passed a nil layout anchor.  This is not allowed, and may cause confusing exceptions. Break 
on BOOL _NSLayoutConstraintToNilAnchor(void) to debug.  This will be logged only once.  This 
may break in the future.