Objective-C 在xp下環境搭建以及使用utraedit高亮顯示編輯代碼

來源:互聯網
上載者:User

GNUstep Windows Installer提供了Windows平台下的Objective-C的類比開發環境,一共有四個軟體包,

其中GNUstep SystemGNUstep
Core
是必裝的,GNUstep DevelCairo
Backend
是選裝的。

甭管必裝選裝,一次性全安上,免得以後麻煩。

編寫Hello, World!

1.安裝後在環境變數PATH中增加:

  C:\GNUstep\GNUstep\System\Tools;C:\GNUstep\bin;C:\GNUstep\mingw\bin

  安裝後運行GNUstep shell也就是安裝目錄下的msys.bat。測試一下gcc與make命令。

2: 測試程式

test.m

1 #import <Foundation/Foundation.h>2 int main (int argc, const char *argv[]) {3 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];4 NSLog(@"Hello World!");5 [pool drain];6 return 0;7 }

3.在Shell中輸入命令:

gcc -fconstant-string-class=NSConstantString -c testm -I /GNUstep/System/Library/Headers

這是目錄裡就會產生test.o和test.exe檔案。

4.UltraEdit下配置Objective-c高亮顯示

#追加到 UltraEdit設定檔末尾

/L14"Objective-C" OBJECTIVE-C_LANG Line Comment = // Block Comment On = /* Block Comment Off = */ Escape Char = \ String Chars = "' String Literal Prefix = @ File Extensions = H M MM PCH
/Delimiters = ~!@%^&*()-+=|\/{}[]:;"'<> , .?
/Function String = "%^([a-zA-Z_0-9^[^]*]+^)[ ^t]+([^p*&:, ^t^[^]a-zA-Z_0-9.!]++)[~;]"
/Function String 1 = "%[a-zA-Z_0-9*]*::^([a-zA-Z_0-9^~]+^)[ ^t^p]++([^p*&:, ^t^[^]/*^-'=:&a-zA-Z_0-9./(!]++)[~;]"
/Function String 2 = "%[a-zA-Z_0-9^][a-zA-Z_0-9^[^]]+[ ^t*]+^([a-zA-Z_0-9]+^)[ ^t]++([^p*&:, ^t^[^]a-zA-Z_0-9./(!]++)[~;]"
/Function String 3 = "%[a-zA-Z_0-9*&$^[^]*]+[ ^t]+[a-zA-Z_0-9*&$^[^]]+[ ^t*]+^([a-zA-Z_0-9]+^)[ ^t]++([^p*&:, ^t^[^]a-zA-Z_0-9./(!]++)[~;]"
/Function String 4 = "%[a-z_0-9^[^]*]++ [a-z_0-9*^[^]]+[ ^t]++[a-z_0-9*^[^]]+[ ^t]++^([*a-z_0-9]+^)[ ^t]++([^p*&:, ^t^[^]a-z_0-9./(!]++)[~;]"
/Function String 5 = "%^([a-zA-Z_0-9^[^]*]+^)[ ^t]++([^p*&:, ^t^[^]a-zA-Z_0-9./()!]++)[~;]"
/Member String = "^([A-Za-z0-9_:.]+^)[ ^t^*&]+$S[ ^t^[^]A-Za-z0-9_]++[(-);,]"
/Variable String = "%[ ^t]++^([!-~ ^t<>]+*[~a-z^p]^)$S[ ^t;,()^-]"
/Indent Strings = "{"
/Unindent Strings = "}"
/Open Brace Strings =  "{" "(" "["
/Close Brace Strings = "}" ")" "]"
/Open Fold Strings = "{"
/Close Fold Strings = "}"
/C1"Keywords" STYLE_KEYWORD
_Bool _Complex _Imaginary _cmd __func__
__asm __based __cdecl __declspec __except __far __fastcall __finally __fortran __huge __inline __int16
__int32 __int64 __int8 __interrupt __leave __loadds __near __pascal __saveregs __segment __segname __self
__stdcall __try __uuidof __multiple_inheritance __single_inheritance __virtual_inheritance
auto do double assign
bool break bycopy byref
BOOL
char class case const continue const_cast catch copy
Class
defined default do double delete dynamic_cast dllexport dllimport
enum extern else explicit export
for float false friend
goto getter
int if in inline inout id init
IMP
long
mutable
nil namespace new naked nonatomic
Nil NO NSObject
oneway out operator
Object
private protected public
Protocol
return register restrict reinterpret_cast retain readwrite readonly
self short signed sizeof static struct super switch static_cast setter
SEL
typedef template this throw true try typeid typename thread
union unsigned using uuid
void volatile virtual
while wchar_t
YES
** @ #
/C2"Operators" STYLE_OPERATOR
@
#
:
!
%
&
+
-
*
// /
<
=
>
^
|
~
?
,
/C3"Framework" STYLE_EXTENSION
alloc
dealloc
Foundation
release
** NS IB CF CA CG UI GL EAGL
/C4"OpenGL" STYLE_KEYWORD
** gl

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.