错误:iPhone私人框架“没有这样的文件或目录”

我已经添加了私人框架到我的项目。 当我build立在DEVICE | RELEASE一切工作正常,我能够ldid -S应用程序,并成功启动我的设备上。

但是,在模拟器中尝试编译和执行时,出现如下所示的“没有这样的文件或目录”的错误:(我也得到两次错误,这也是奇怪的。)

Line Location HomeProfileViewController.h:10: error: BluetoothManager/BluetoothManager.h: No such file or directory 

下面是我现在有的项目和构build设置,也许有人可以find一个错误,让我知道,这将是太棒了!

项目设置:

 PRIVATE_HEADERS_FOLDER_PATH = "/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include" PUBLIC_HEADERS_FOLDER_PATH = "/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include" USER_HEADER_SEARCH_PATHS = "/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include" OTHER_CFLAGS = "-I/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include-I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/include-I/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/gcc/arm-apple-darwin9/4.0.1/include-F/System/Library/Frameworks-F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks-F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/PrivateFrameworks-DMAC_OS_X_VERSION_MAX_ALLOWED=1050" 

目标build设设置:

 PRIVATE_HEADERS_FOLDER_PATH = "/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/PrivateFrameworks" FRAMEWORK_SEARCH_PATHS = "$(inherited) $(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks" USER_HEADER_SEARCH_PATHS = "/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include/**" OTHER_CFLAGS = "-I/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include-I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/include-I/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/gcc/arm-apple-darwin9/4.0.1/include-F/System/Library/Frameworks-F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks-F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/PrivateFrameworks-DMAC_OS_X_VERSION_MAX_ALLOWED=1050" 

注意:path中的引号实际上并不在我的项目中,所以我把它们放在网站中,这样网站将会更好地语法化它们。

苹果蠹

实际上,对于SDK 3.0+,请确保二进制文件和头文件在PrivateFrameworks文件夹中,如以下示例所示: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/PrivateFrameworks/BluetoothManager。骨架

二进制文件和头文件必须位于此目录下,头文件必须位于/头文件中,例如: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/PrivateFrameworks/BluetoothManager.framework/Headers /BluetoothManager.h

然后使用这些语句,你将需要私人头文件:

 #if TARGET_IPHONE_SIMULATOR //This is where you put code for simulator #else //Private functions will go here! #endif 

现在你可以从上面列出的第一个目录添加私人框架,你可以build立和去模拟器,并build立设备! 在设备/模拟器之间切换时,你不必添加/删除框架!