2016-11-16 23 views
0

我在Add HomeKit Accessory Alert(图1)中按Add Anyway约6秒后出现Add Accessory View Controller(图2),这个问题在等待时间较长时出现问题。 (Xcode的8.2-β,部署目标:10.0,设备IOS时:10.1.1)为什么在长时间延迟后出现“添加附件”视图控制器?

的代码是相当简单:

homeHMHome
accessoryHMAccessory

override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 
    defer { 
     tableView.deselectRow(at: indexPath, animated: true) 
    } 

    let accessory = accessories[indexPath.item] 

    home.addAccessory(accessory) { error in 
     // ... 
    } 
} 

我已经尝试将代码包装在DispatchQueue.main.async { /**/ }中,但不会将演示文稿固定。


这只是一个问题,因为附件是不是(还)认证,还是我忘记配置/等待的东西之前,我可以叫addAccessory安全?

注:我在HomeKit example provided by Apple


Figure 1: Add HomeKit Accessory Alert
Add HomeKit Accessory Alert

Figure 2: Add Accessory View Controller
Add Accessory View Controller

+0

这不是一个需要时间准备的问题 – SRI

回答

0

的添加附件时,同样的问题当我更新Bridge的固件时,问题就消失了。

相关问题