我想在 swift 或 objective-c 中包含 BluetoothManager 框架,遇到问题
I want to include BluetoothManager framework in swift or objective-c, having problems
我在项目中包含框架时遇到问题。
我已经从 https://github.com/nst/iOS-Runtime-Headers/tree/master/PrivateFrameworks 下载了私有 API
据我所知,这为我提供了头文件,以便与 xcode 中已有的框架一起使用。
我已将头文件添加到 xcode 中的框架文件夹中,用于蓝牙管理器。
我还在 xcode 中包含了这个框架。
"framework search paths"是:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/PrivateFrameworks
这是我的 xcode 文件夹结构的图片:
当我尝试包含头文件时出现错误 "BluetoothManager/BluetoothManager.h file not found"。
这是相关代码:
#include <BluetoothManager/BluetoothManager.h>
Objective-C 与 C/C++ 有相同之处;引用形式用于 "local" 包含文件(您需要指定当前文件的相对路径,例如 #include "headers/my_header.h"
),而 angle-bracket 形式用于 "global" 包含-- 在传递给编译器的包含路径中找到的那些(例如 #include <math.h>
)。
因此,要让您自己的 header 使用 < > 而不是 " ",您需要将 header 目录的相对路径或绝对路径传递给编译器。
我在项目中包含框架时遇到问题。
我已经从 https://github.com/nst/iOS-Runtime-Headers/tree/master/PrivateFrameworks 下载了私有 API
据我所知,这为我提供了头文件,以便与 xcode 中已有的框架一起使用。
我已将头文件添加到 xcode 中的框架文件夹中,用于蓝牙管理器。
我还在 xcode 中包含了这个框架。
"framework search paths"是:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/PrivateFrameworks
这是我的 xcode 文件夹结构的图片:
当我尝试包含头文件时出现错误 "BluetoothManager/BluetoothManager.h file not found"。
这是相关代码:
#include <BluetoothManager/BluetoothManager.h>
Objective-C 与 C/C++ 有相同之处;引用形式用于 "local" 包含文件(您需要指定当前文件的相对路径,例如 #include "headers/my_header.h"
),而 angle-bracket 形式用于 "global" 包含-- 在传递给编译器的包含路径中找到的那些(例如 #include <math.h>
)。
因此,要让您自己的 header 使用 < > 而不是 " ",您需要将 header 目录的相对路径或绝对路径传递给编译器。