【发布时间】:2015-01-10 07:53:36
【问题描述】:
我正在尝试向Home(HMHome) 添加附件,并且始终执行错误块。我收到GenericError,这意味着发生了一个错误,没有更具体的错误代码。
即使文档没有正确的原因,我也无法理解此错误的原因。
这是从前一天开始发生的,早些时候我能够通过相同的代码添加配件。
if (self.home != nil ){
self.home!.addAccessory(accessory, completionHandler: ({(error:NSError!) in
if ( error != nil) {
//Method which returns error alert according.
self.handleError(error)
}
else{
let alert:UIAlertController = UIAlertController(title: "HomeKitPOC", message: "Accessory added successfully", preferredStyle: .Alert)
alert.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.Default, handler:{
(action:UIAlertAction!) in
self.dismissViewControllerAnimated(true, completion: nil)
}))
self.presentViewController(alert, animated: true, completion: nil)
}
}))
}
遇到过类似问题或有什么建议的人。
【问题讨论】:
标签: swift ios8 xcode6.1 ios-homekit