【问题标题】:XCode HealthThermometer example compile errorXCode HealthThermometer 示例编译错误
【发布时间】:2017-07-05 05:52:25
【问题描述】:

大家好!我是使用 Xcode 和 Objective-c 编码的新手。我正在使用 8.2 Xcode,我尝试从那里编译 HealthThermometer 示例 https://developer.apple.com/library/content/samplecode/HealthThermometer/Introduction/Intro.html 它给出了很多错误:

有什么问题?

提前致谢!

【问题讨论】:

    标签: xcode core-bluetooth


    【解决方案1】:

    那是相当古老的示例代码。它缺少核心蓝牙所需的#import,并尝试链接到较旧的 IOBluetooth 库。

    为了编译它,您需要将 HealthThermometerClientAppDelegate.h 的顶部更改为:

    #import <Cocoa/Cocoa.h>
    #import <CoreBluetooth/CoreBluetooth.h>
    

    您还需要进入项目设置并删除 IOBluetooth 框架并添加对 CoreBluetooth.framework 的引用

    【讨论】:

      猜你喜欢
      • 2017-10-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-22
      相关资源
      最近更新 更多