最近進行iPhone的開發,使用了Cocoa,感覺Cocoa設計很精緻,Objecitive-c文法也很簡單和易用,是以想是否在Windows下也有可以運作的環境,這樣可以友善使用,否則隻在MAC上用,安裝虛拟機或購買硬體都比較麻煩,搜尋了一下資料,還真有這方面的工具。
關于cocoa跨平台的問題
<a href="http://stackoverflow.com/questions/2049099/cocoa-programming-on-windows">http://stackoverflow.com/questions/2049099/cocoa-programming-on-windows</a>
<a href="http://www.gnustep.org/">http://www.gnustep.org/</a>
The purpose of this project is to create a free and open version of the Cocoa (formerly known as NeXTSTEP/OpenStep) APIs and tools for as many platforms as possible.
GNUstep provides a robust implementation of the AppKit and Foundation libraries as well as the development tools available on Cocoa, including Gorm (the InterfaceBuilder) and ProjectCenter (ProjectBuilder/Xcode). GNUstep currently supports Unix (GNU/Linux and GNU/HURD, Solaris, NetBSD, OpenBSD, FreeBSD, Darwin) and Windows.
可見這個開源項目建構了和Xcode InterfaceBuilder及Objective-c Cocoa的運作環境等系列的工具
<a href="http://www.cocotron.org/">http://www.cocotron.org/</a>
Cocotron項目的目标是實作一個跨平台的類似蘋果公司Cocoa的Objective-C API。包括AppKit、Foundation、Objective-C運作庫和支援其他函數庫,諸如CoreGraphics和CoreFoundation。
<a href="http://www.cocoachina.com/b/?p=144">http://www.cocoachina.com/b/?p=144</a>
通過比較gnuStep比較完整,可以作為整個環境的體驗和學習開發使用,Cocotron就沒有再細看
最新版本的安裝
<a href="http://www.gnustep.org/experience/Windows.html">http://www.gnustep.org/experience/Windows.html</a>
objective-c和Cocoa架構的編譯環境
gnustep-msys-system-0.25.1-setup.exe
gnustep-core-0.25.0-setup.exe
gnustep-devel-1.1.1-setup.exe
gnustep-cairo-0.22.1-setup.exe
類似Interface Builder的界面設計工具
gorm-1.2.12-setup.exe
例子工具
gnustep-examples-1.3.0.tar.gz
gworkspace-0.8.8.tar.gz
ProjectCenter-0.6.0.tar.gz
SystemPreferences-1.1.0-1-setup.exe
上面這個版本的ProjectCenter需要自己編譯使用[代碼中有相關的文檔說明]
<a href="http://www.jaysonjc.com/programming/objective-c-programming-in-windows-gnustep-projectcenter.html">http://www.jaysonjc.com/programming/objective-c-programming-in-windows-gnustep-projectcenter.html</a>
是一個使用已有版本的功能說明,使用以下:
gnustep-system-0.22.0-setup.exe
gnustep-core-0.22.0-setup.exe
gnustep-devel-1.0.0-setup.exe
gorm-1.2.8-setup.exe
ProjectCenter-0.5.0-setup.exe
按照以上的順序安裝,就把編譯環境項目工具、界面工具安裝完成
[我的機器上安裝完後(Windows7 64)Build項目時提示make檔案找不到,沒有找到好的解決辦法,有空可以再看看ProjectCenter的代碼,有ProjectCenter熟悉一下工程的組織就行了,可以使用make指令行自己編譯]
<a href="http://www.gnustep.org/experience/PierresDevTutorial/index.html">http://www.gnustep.org/experience/PierresDevTutorial/index.html</a>
這個位址講述了ProjectCenter gorm建立項目和界面的步驟
安裝好的程式組菜單,Shell可以啟動MingW Shell環境,此時可以使用gcc g++ make等工具,對于linux等熟悉的對這個很清楚
Gorm ProjectCenter是啟動的指令

Shell視窗:可以編譯項目等操作
Gorm視窗:設計界面群組件布局
ProjectCenter視窗:項目建立、代碼高亮察看
GnuStep可以使用Objective-c和Cocoa,注意這個Cocoa和apple的官方cocoa實作還是有差别的。
這個工具實作了AppKit,對于iOS的UIKit沒有實作
不過隻要對這個熟悉了以後,那麼進行iPhone/iPad和MAC的開發很容易