NSString objects represent an immutable string of characters. NSString itself is an abstract class which provides factory methods to generate objects of unspecified subclasses.
A constant NSString can be created using the following syntax:
@"..."
, where the contents of the quotes are the
string, using only ASCII characters.
To create a concrete subclass of NSString, you must have your class inherit from NSString and override at least the two primitive methods - length and characterAtIndex:
In general the rule is that your subclass must override any initialiser that you want to use with it. The GNUstep implementation relaxes that to say that, you may override only the designated initialiser and the other initialisation methods should work.
Returns an array of all available string encodings, terminated by a null value.
Returns the encoding used for any method accepting a C string. This value is determined automatically from the programs environment and cannot be changed programmatically.
You should NOT override this method in an attempt to change the encoding being used.
In GNUstep, this encoding is determined by the initial value
of the GNUSTEP_STRING_ENCODING
environment
variable. If this is not defined,
NSISOLatin1StringEncoding
is assumed.
The default C string encoding must be a characterset containing 7 or 8 bit characters, and where the characters are a superset of the 7-bit ASCII characterset. In particular, this means that NSUTF8StringEncoding and NSUnicodeStringEncoding are not permissable.
Returns the localized name of the encoding specified by encoding.