看板 MacDev 關於我們 聯絡資訊
全刪 Framework = Versioned(Headers + Lib + Resources) + Metadata 隨便開一個內建的看就知道了 $ ls /System/Library/Frameworks/Foundation.framework/ Foundation Headers Resources Versions XPCServices module.map module.map 用來指示該 framework 要 export 的東西 (應該和 Windows 的 Manifest 差不多, 雖然其實我不太懂那個所以不確定XD) 除了 Versions 以外其他都是 soft link 到 Versions 裡面 $ ls -l /System/Library/Frameworks/Foundation.framework/Versions/ drwxr-xr-x 6 root wheel 238 Dec 25 18:07 C lrwxr-xr-x 1 root wheel 1 Dec 24 18:31 Current -> C 沒難度, 跳過 $ ls -l /System/Library/Frameworks/Foundation.framework/Versions/C total 7808 -rwxr-xr-x 1 root wheel 10474768 Dec 24 18:31 Foundation drwxr-xr-x 2 root wheel 4930 Oct 1 04:04 Headers drwxr-xr-x 36 root wheel 1462 Dec 24 18:32 Resources drwxr-xr-x 3 root wheel 102 Aug 27 12:06 XPCServices drwxr-xr-x 2 root wheel 102 Dec 24 18:31 _CodeSignature 第一個就是 library 本體, 第二三個應該很容易理解 第四個其實也是一個 resource, 最後就...code signature Framework 被引用的時候通常都是會使用 Current 版本 但是根據狀況可能在 Versions 裡面可以有很多個項目, Current 指向其中一個 這樣就可以消除 binary incompatibility 的問題 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.94.57
HuangJC:以前 .h 給 compiler 看(而且引用者必需明確 include) 02/14 15:47
HuangJC:.lib 給 linker 用;所以其實沒引入 lib 是會有 link error 02/14 15:48
HuangJC:有引入 lib 但沒明確 include 呢? 那 compile time 就 err 02/14 15:48
HuangJC:現在有 framework,包裝裏有 .h,但你還是得自己 include 02/14 15:49
HuangJC:所以我感受到的好處只有.. "大哥都替你包在一起,省得找"了 02/14 15:50
HuangJC:倒是 include 時,我常省略打路徑,compiler 竟也找得到 02/14 15:51
HuangJC:這實在開心多了,如果 framework打包有這好處,那就'有感' 02/14 15:51
HuangJC:(有感 是最近流行的字眼吧 :P) 02/14 15:52