開始學習 Objective-C 時,常常會遇到一個問題”參考的中文書來不及更新成最新的“,這個自己也要檢討,因為最新的資料都在 Apple 的網頁上;只是有時看中文書,學習速度會快一點。因為技術一直在進步,新的功能也一直在增加,對於剛開始學習的人來說,有時真的很難理解,因為還不知道它的來龍去脈,這只能靠持續學習來克服這個問題了!
回到正題,Property Synthesis 是我一開始不太了解的東西,因為它的寫法很不同。
原本的寫法
2013年1月15日 星期二
2012年12月10日 星期一
FFmpeg tutorial on Mac OS X - tutorial03
這個 tutorial03 花了我不少時間,而且現在還有 Audio 的問題還沒有解決,因為過程中有很多地方需要注意,所以就先紀錄下來。
在前兩個 tutorials ( FFmpeg tutorial on Mac OS X - tutorial01, FFmpeg tutorial on Mac OS X - tutorial02 ) 中,我使用的編譯方式是,在終端機裡以 Configure 和 Make 的方式來進行編譯,需要額外的函式庫就加入它們來使用。但是在 tutorial03 中,卻一直沒辦法用同樣的方式,產生可用的執行檔。這裡說“可用的”是代表我的確已經編譯成功了,但是執行時會發生 crash 的現象,讓我找問題找了很久。
在 tutorial03 的練習中,主要是加入了 Audio,我使用的程式碼在 Linux 平台上已經驗證過(見 FFmpeg tutorial practice - tutorial03 ),也聽得到 Audio 的播放,但是在 Mac OS X 平台上,就是沒有辦法聽到!
在前兩個 tutorials ( FFmpeg tutorial on Mac OS X - tutorial01, FFmpeg tutorial on Mac OS X - tutorial02 ) 中,我使用的編譯方式是,在終端機裡以 Configure 和 Make 的方式來進行編譯,需要額外的函式庫就加入它們來使用。但是在 tutorial03 中,卻一直沒辦法用同樣的方式,產生可用的執行檔。這裡說“可用的”是代表我的確已經編譯成功了,但是執行時會發生 crash 的現象,讓我找問題找了很久。
在 tutorial03 的練習中,主要是加入了 Audio,我使用的程式碼在 Linux 平台上已經驗證過(見 FFmpeg tutorial practice - tutorial03 ),也聽得到 Audio 的播放,但是在 Mac OS X 平台上,就是沒有辦法聽到!
標籤:
FFmpeg,
Multimedia,
OS X
2012年12月7日 星期五
GCC option on Mac : -framework
之前在 FFmpeg tutorial on Mac OS X - tutorial01 中有提到,在 Mac 上編譯時會需要某些函式庫的東西,我們可以利用 -framework 這個 GCC 選項來加入我們所需要的函式庫,那時使用時,還不太了解它的作用。今天找到了它的使用說明,原來在 Apple Developer 的網站上有寫:
gcc(1) OS X Developer Tools Manual Page
In addition to the options listed below, Apple's GCC also accepts and passes nearly all of the
options defined by the linker ld and by the library tool libtool. Common options include -framework,
-dynamic, -bundle, -flat_namespace, and so forth. See the ld and libtool man pages for further
details.
ld(1) OS X Developer Tools Manual Page
看來 Apple Developer 要常去呀!
gcc(1) OS X Developer Tools Manual Page
In addition to the options listed below, Apple's GCC also accepts and passes nearly all of the
options defined by the linker ld and by the library tool libtool. Common options include -framework,
-dynamic, -bundle, -flat_namespace, and so forth. See the ld and libtool man pages for further
details.
ld(1) OS X Developer Tools Manual Page
-framework name[,suffix]
This option tells the linker to search for `name.framework/name' the framework search path.
If the optional suffix is specified the framework is first searched for the name with the
suffix and then without (e.g. look for `name.framework/name_suffix' first, if not there try
`name.framework/name').
在 Mac OS X 中複製絕對路徑
為什麼會需要這個功能?因為我在 Xcode 中對某一個檔案按右鍵,選擇直接在 Finder 中顯示,而在 Finder 中又無法直接複製絕對路徑(我只知道可以顯示路徑列),所以才會去找怎麼複製絕對路徑的方法。
這個方法是這樣的:
1.打開終端機
2.在 Finder 上找到你要複製的路徑上的檔案或資料夾
3.選擇那個檔案或資料夾,把它拖拉到終端機上
4.終端機就會顯示絕對路徑
我還有找到有了寫了一個應用程式來做這件事,但我不想安裝,就用這個了。
這個方法是這樣的:
1.打開終端機
2.在 Finder 上找到你要複製的路徑上的檔案或資料夾
3.選擇那個檔案或資料夾,把它拖拉到終端機上
4.終端機就會顯示絕對路徑
我還有找到有了寫了一個應用程式來做這件事,但我不想安裝,就用這個了。
2012年12月4日 星期二
FFmpeg tutorial on Mac OS X - tutorial02
練習過 tutorial01 on Mac OS (見 FFmpeg tutorial on Mac OS X - tutorial01) 之後,接著我們繼續來實作 FFmpeg tutorial02 on Mac OS。如果還記得在 Linux 平台的 FFmpeg tutorial02 (見 FFmpeg tutorial practice - tutorial02),它需要加入第三方的函式庫 SDL,同樣地,我們也要準備給 Mac OS 用,所以去下載原始碼,然後編譯吧!編譯完之後,再設定 tutorial02 的 Makefile,就像在 Linux 平台做的事一樣。記得一樣要加入 Mac OS 所需要的函式庫!以下是我用的 Makefile
標籤:
FFmpeg,
Multimedia,
OS X
2012年12月3日 星期一
FFmpeg tutorial on Mac OS X - tutorial01
之前已試過在 Linux 的平台上練習 FFmpeg tutorial (見 FFmpeg tutorial practice - tutorial01),接著我想在 Mac OS X 上也做一樣的事。理論上,需要修改的地方應該不多,只是細節要怎麼處理就需要花一點時間試。當我把程式碼從 Linux 平台上放到 Mac OS 的平台上時,一樣先從 tutorial01 開始;當然,我們需要 Mac 版的 FFmpeg,所以需要在 Mac OS 平台上編譯出它的函式庫來用。我算是 Mac OS 平台上的新手,大約一年多的使用經驗,在 Linux 平台上知道怎麼做的事,到 Mac OS 平台上卻不一定知道怎麼處理。不過沒關係,花點時間找一下就可以了。
首先我遇到的是新增函式庫的問題,我使用的 Linux 平台是 Ubuntu,如果少了某某函式庫,可以用很多方式去安裝新的函式庫,Ubuntu 的軟體中心(Ubuntu Software Center)也做的不錯,可以很容易管理你的軟體安裝結果;但在 Mac OS 平台上,是用不同的方式做的,目前我用的是 MacPorts 來管理,因為在編譯 FFmpeg 時,遇到有缺少函式庫的問題,所以我用了 MacPorts 去新增了需要的函式庫。(MacPorts 的使用方法,在這裡就不說了,利用 Google 可以找到很多的說明。)
首先我遇到的是新增函式庫的問題,我使用的 Linux 平台是 Ubuntu,如果少了某某函式庫,可以用很多方式去安裝新的函式庫,Ubuntu 的軟體中心(Ubuntu Software Center)也做的不錯,可以很容易管理你的軟體安裝結果;但在 Mac OS 平台上,是用不同的方式做的,目前我用的是 MacPorts 來管理,因為在編譯 FFmpeg 時,遇到有缺少函式庫的問題,所以我用了 MacPorts 去新增了需要的函式庫。(MacPorts 的使用方法,在這裡就不說了,利用 Google 可以找到很多的說明。)
標籤:
FFmpeg,
Multimedia,
OS X
訂閱:
文章 (Atom)