本文介绍了iOS SDK Hue Philips与Swift的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在Objective C中为Hue导入iOS SDK。

I tried to import iOS SDK in Objective C for Hue.

我按照以下说明操作:

I followed instructions here : https://github.com/PhilipsHue/PhilipsHueSDK-iOS-OSX

我添加了HueSDK_iOS .framework到我的项目,我添加了所有Lumberjack文件,我用导入行创建了.h。

I added the HueSDK_iOS.framework to my project, I added all Lumberjack files and I created the .h with the import line.

之后,我在我的代码中使用了:

After, I used in my code :

var phHueSdk : PHHueSDK = PHHueSDK()
var searching : PHBridgeSearching = PHBridgeSearching()

我有这样的错误:



I found many solutions for this problem like add files to the compile sources for example. It doesn't work.

更新:

此问题在以下情况得到解决您在项目的构建阶段将SDK添加到链接二进制中WatchKit扩展

This problem is solve when you add your SDK to Link Binary in Build Phases of your project WatchKit Extension

新问题:

我在watchOS上工作。也许SDK不支持watchOS

I work on watchOS. Maybe the SDK doesn't support watchOS

推荐答案

对,它被命名为HueSDK_ iOS .framework for a原因:iOS和watchOS是两种不同的操作系统,有两种不同的架构。

Right, it's named HueSDK_iOS.framework for a reason: iOS and watchOS are two different operating systems, with two different architectures.

相反,要么让你的手表应用程序与你的手机应用程序通话(推荐),要么放弃完全SDK并让您的监视应用发送http / json直接读取和写入桥JSON,使用 NSURLSession NSJSONSerialization

Instead, either have your watch app talk to your phone app (recommended), or ditch the SDK completely and have your watch app send http/json to read and write the bridge JSON directly, using NSURLSession and NSJSONSerialization.

这篇关于iOS SDK Hue Philips与Swift的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 21:44