코어 파운데이션 (결국, NSBundle은 CFBundle을 기반으로합니다.) 소스 코드를보고 결국 문제가 무엇인지 알아 냈습니다. 그래서 ..
info.plist 콘텐츠를 수집하는 기능은 CFBundleGetInfoDictionary입니다. 이것은 이론적으로 plist에 포함 된 정보가 요청 될 때마다 호출됩니다. CFBundle.c 보면
는 CFBundleGetInfoDictionary 검사의 구현은 번들의 _infoDict 필드는 초기화되어 있는지 여부와 그렇지 않은 경우에, 그것을 초기화 : 내 CFBundle에 그 함수를 호출하여
if (!bundle->_infoDict) bundle->_infoDict = _CFBundleCopyInfoDictionaryInDirectoryWithVersion(CFGetAllocator(bundle), bundle->_url, bundle->_version);
을 나는 운이 없었기 때문에, 뭔가 잘못되었다고 짐작했다. _CFBundleCopyInfoDictionaryInDirectoryWithVersion.
source code에서 번들 ->_version에 따라 정보 경로를 검색하는 데 다른 경로가 사용되었습니다. 이 경우 버전은 번들을 설정하는 데 사용 된 dir 구조에 따라 다릅니다. ,
// check for existence of "Resources" or "Contents" or "Support Files"
// but check for the most likely one first
// version 0: old-style "Resources" bundles
// version 1: obsolete "Support Files" bundles
// version 2: modern "Contents" bundles
// version 3: none of the above (see below)
// version 4: not a bundle (for main bundle only)
그래서 이야기를 완료하려면 : (번들 초기화 중에 사용) 기능 _CFBundleURLLooksLikeBundleVersion에 지정된대로 자원 디렉토리에 번들 때문에 정확하게하기 위해, 내 버전이 0했다이 있습니다 Info의 기본 URL.PLIST는 다음과 같이 정의되어있는 버전 0
infoURLFromBase = _CFBundleInfoURLFromBase0;
에 따라 _CFBundleCopyInfoDictionaryInDirectoryWithVersion 초기화합니다 : soooo를
#define _CFBundleInfoURLFromBase0 CFSTR("Resources/Info.plist")
... 내가 넣어 한 내 자료에 의 Info.plist 디렉토리 및 밖이 아니며 이제는 작동합니다.
나는이 여행이 문서의 어딘가에 쓰여졌을 것이기 때문에이 여행을 다했기 때문에 어리석은 것 같다.하지만 찾을 수가 없었다. (