2013-01-31 47 views
0

可能重複:
What does the @ symbol represent in objective-c?Objective C中的@符號是什麼?

我是ANSI C的專家,我採取的第一個步驟學習目標C.

我應該怎樣想的/讀取「 @「那種東西到處都是?首先,我認爲它是一個編譯器指令 - 「在編譯器的一條指令中爲getter/setter生成」的「@synthesize someProperty」。

但字符串之前的「@」似乎不適合該模型,並且似乎基本上是多餘的。

對於C專家對「如何快速學習Objective C」的任何建議也會很高興。謝謝,

彼得

+1

我認爲使用了@ -sign,因爲ObjC是C語言的擴展,並且使用這個標記可以防止現有C代碼的任何問題。 –

+1

try ** [this](http://www.google.co.uk/webhp?hl=zh-CN&tab=ww&authuser=0#hl=zh-CN&safe=active&tbo=d&authuser=0&site=webhp&q=objective+c+developer+reference&oq=客觀+ C + +顯影劑參考&gs_l = serp.3..35i39j0j0i10i30j0i30l5j0i8i30j0i30.14895.15276.3.15572.4.4.0.0.0.0.88.289.4.4.0.les%3B..0.0 ... 1c.1.qFHQ53UaAYo&BAV = on.2, or.r_gc.r_pw.r_cp。&bvm = bv.41642243,d.ZGU&fp = 1d98386d32127408&biw = 1842&bih = 964)**,它可以幫助您... – holex

回答

-1

@只是一個字符,除非你有完整的上下文

@interface //For declaring a class 
@property // For creating a property 
@synthesize // For synthesising property 
@implementation //For implementing a class 
@end //For ending @interface or @implementation 
@"Some String" //Represents a string 
@try 
@catch 

等使用。
這麼簡單@是什麼都沒有,但當它合併成爲指令

+0

它們不是關鍵字。最後一個是編譯器指令 – CodaFi

+0

@CodaFi感謝您糾正 –

+1

...和@ [obj1,obj2,...]或@ {key1:value1,key2:value2,...}或@( 12)或@(FALSE)等等,它們只是編譯器的指示而已。 – holex

相關問題