Enlighten more
Reply:
@ "Test"
Like this???
The statement seems to be similar to the index
Reply:
Well, put a string in front. It means you declare a string?
Reply:
On a string in front of you on behalf of this string is NSString type.
Hold it, on behalf of your string is C-style strings.
Reply:
3rd Floor, positive solutions
Reply:
Information on the proposed landlord a look at the first Objective-c
Reply:
3rd Floor, positive solutions
Official Learing Objective-C documentation comes in part of a String===
The NSString class provides an object wrapper for strings that has all of the advantages you would expect, including built-in memory management for storing arbitrary-length strings, support for Unicode, printf-style formatting utilities, and more. Because such strings are used commonly though, Objective-C provides a shorthand notation for creating NSString objects from constant values. To use this shorthand, all you have to do is precede a normal, double-quoted string with the @ symbol
===
Address:
http://developer.apple.com/library/ios/ # referencelibrary / GettingStarted / Learning_Objective-C_A_Primer /
Reply:
Objective-C is an extension of the C language, one of which is the string expansion is NSString Objective-C object. In the C language, string is a pointer to a block of contiguous memory NULL character end, the distinction between C and Objective-C string constant string constant, there is to see in front of @. Such as:
/ / C string
char * foo;
/ / NSString
NSString * bar;
foo = "this is a C string";
bar = @ "this is an NSString";
In addition, there is a case.
In order to reduce conflict C code and Objective-C code between, Objective-C keywords are using @ as a prefix. For example, @ end, @ implementation, @ class, @ selector, @ protocol, @ property, @ synthesize.
No comments:
Post a Comment