iOS-Framework
iOS-Framework copied to clipboard
Xcode 4.5.2 Path Issue + Private/Public Headers
In Xcode 4.5.2 I had to make some changes:
- I had to change the last line in the script for the library target. Otherwise I had an error saying that the cp command's file/folder did not exist.
/bin/cp -a "${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/A/Headers"
TO
/bin/cp -a "${TARGET_BUILD_DIR}/include/${PRODUCT_NAME}/" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/A/Headers"
- I had to "Add Build Phase" for the "Copy Headers" for the Static Library template. It was not enabled by default for iPhone. After adding it I was able to copy the headers.

Looks like there's a better fix, and you can still use the original script.
With the static library template, you'll need to change the "Copy Files" destination from "include/${PRODUCT_NAME}" to "${PRODUCT_NAME}"
This will make the build script work. The previous solution I had would fail on the Archive step for a test app using the library.

If you set the PUBLIC_HEADERS_FOLDER_PATH properly you can just remove the Copy Files build phase altogether. The script will copy the headers properly using that value.
Likewise I found it necessary to add the Copy Headers phase to enable adding any headers to the public headers part of the target.