建立靜態庫或跨專案元件時,Build Settings 中有多項路徑與編譯參數需要調整。以下整理常見欄位的意義。
Installation Directory 可設為 $(BUILT_PRODUCTS_DIR),Skip Install 設為 YES,避免被安裝到系統預設路徑。Public Headers Folder Path 常設為 include,讓使用此庫的專案能找到公開標頭檔。
User Header Search Paths 可指向公開標頭所在位置,例如 $(BUILT_PRODUCTS_DIR)/include。Library Search Paths 則用來尋找連結的函式庫。
Per-configuration Build Products Path 可自訂最終產物位置;Per-configuration Intermediate Build Files Path 則用於存放暫時的中間檔。
Code Signing Identity 需選擇與 Bundle identifier 相符的憑證。Architectures 與 Valid Architectures 可設定 armv6、armv7 或 i386,並依 Deployment Target 調整。
Product Name 預設為 $(TARGET_NAME),Info.plist File 指定資訊清單,Other Linker Flags 常加入 -ObjC。若使用類別,需特別注意靜態庫連結問題。
Prefix Header 可指定預編譯標頭,Precompile Prefix Header 設為 Yes 可加快編譯。OpenGL ES 支援需依裝置世代判斷,例如部分舊設備僅支援 1.1。