문제

내 프로젝트에 개인 프레임워크를 추가했습니다.장치를 구축 할 때 | 모든 것이 잘 작동하며 응용 프로그램을 LDID로 만들 수 있으며 장치에서 성공적으로 시작됩니다.

그러나 시뮬레이터에서 BUILD AND GO를 시도하면 아래와 같이 "해당 파일 또는 디렉터리가 없습니다"라는 오류가 발생합니다.(나도 이상하게도 오류가 두 번 발생합니다.)

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

다음은 제가 현재 갖고 있는 프로젝트 및 빌드 설정입니다. 누군가가 실수를 찾아 알려줄 수 있다면 정말 좋을 것 같습니다!

프로젝트 설정:

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"

타겟 빌드 설정:

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"

메모:경로의 따옴표는 실제로 내 프로젝트에 없으므로 사이트에서 더 나은 구문을 사용하도록 삽입했습니다.

시디아

도움이 되었습니까?

해결책

실제로 SDK 3.0+의 경우 다음 예와 같이 바이너리와 헤더가 PrivateFrameworks 폴더에 있는지 확인하세요./Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/PrivateFrameworks/BluetoothManager.framework

바이너리 및 헤더 파일은 이 디렉터리 아래에 있어야 하며, 헤더는 /Headers 아래에 있어야 합니다. 예를 들면 다음과 같습니다./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

이제 위에 나열된 첫 번째 디렉터리에서 프라이빗 프레임워크를 추가할 수 있으며, 시뮬레이터를 빌드하고 이동하여 장치용으로 빌드할 수 있습니다!장치/시뮬레이터 간 전환 시 프레임워크를 추가/삭제할 필요가 없습니다!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top