Objective-C 在xp下环境搭建以及使用utraedit高亮显示编辑代码

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


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

风口猪炒股指标

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值