将附件添加到家庭总是返回错误(GenericError)

编程入门 行业动态 更新时间:2024-10-10 05:27:13
本文介绍了将附件添加到家庭总是返回错误(GenericError)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试向Home(HMHome)添加附件,并且始终执行错误块.我收到GenericError,这表示发生了一个错误,没有更具体的错误代码. 即使文档没有正确的原因,我也无法理解此错误的原因.

I am trying to add a accessory to Home(HMHome) and always error block is execute. I am getting GenericError which means An error occurred for which there is no more specific error code. I am not able to understand the reason of this error even documentation does not has the proper reason of it.

这是从上一天开始发生的,更早之前,我能够通过相同的代码添加附件.

And This is happening since last one day, earlier i was able to add the accessory by the same code.

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) } })) }

遇到类似问题或有任何建议的人.

Anybody who has faced the similar problem or have something to suggest.

推荐答案

我知道了此问题的实际根本原因. 当我尝试将测试的iPhone设备与BLE设备配对时.它没有有效的互联网连接.因此,我遇到了提到的错误.

I got the actual root cause of this issue. When I was trying to pairing-up my testing iPhone device with the BLE device. It was not having an active internet connection. Due to this I was getting the mentioned error.

并且为了在与BLE设备配对期间添加附件,非常需要适当的Internet连接.

And in order to add an accessory during the paring-up with BLE device, a proper internet connection is much needed.

一旦互联网连接正确,一切都会开始正常运行.

Once there was the proper internet connection, everything started working fine.

更多推荐

将附件添加到家庭总是返回错误(GenericError)

本文发布于:2023-11-09 04:05:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1571354.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:附件   错误   家庭   GenericError

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!