This is NSMutableString.rtf in view mode; [Download] [Up]
paperh18648 margl-907 margr0 margt0 margb0 fi0 ri0 ql sb0 f1 fs24 Copyright f3 'e3f1 1994 by NeXT Computer, Inc. All Rights Reserved. s4 li100 fi0 ri1007 ql f0 b fs36 fs100 fs36 NSMutableString pard s11 li2872 fi-2771 ri1007 ql tx2872 f1 b0 fs28 fs48 fs28 f0 b fs24 Inherits From:tab b0 fs28 f1 NSString : NSObject fs20 fs28 s6 f0 b fs24 Conforms To:tab b0 fs28 f1 NSCoding, NSCopying, NSMutableCopying (NSString) fi0 NSObject (NSObject) fs20 fs28 s7 fi-2771 f0 b fs24 Declared In:tab b0 fs28 f1 Foundation/NSString.h fs20 fs28 pard s16 li100 fi0 ri1007 ql f0 b fs28 fs20 fs28 Class Description fs14 fs28 pard s1 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 fs2 fs28 NSMutableString (and NSString) declare the programmatic interface for objects that create and managemutablei representation-independenti0 character strings. For a more general overview of string classes, see the description of NSString. fs16 fs28 NSMutableString (and NSString) are abstract classes for string manipulation. NSMutableString declares the interface to objects that inherit all the capabilities of NSString objects, but in addition allow for modification of the string data. NSString and NSMutableString provide factory methods that return autoreleased instances of unspecified subclasses of strings. fs16 fs28 You can instantiate an NSMutableString object by sending any of the b stringWithb0 'bc methods to the NSMutableString class object. This set of methods also includes b localizedStringWithFormat:b0 . A newly allocated NSMutableString object can also be initialized using the b initWithCapacityb0 : method, to set the string to a specified capacity. fs16 fs28 pard s16 li100 fi0 ri1007 ql f0 b fs24 fs28 Creating Temporary Strings fs14 fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 + (NSMutableString *)b localizedStringWithFormat:b0 (NSString *)i formati0 ,... s9 li7030 fi-6553 fi-5796 tab Returns a string created by using i formati0 as a b printf() b0 style format string, and the following arguments as values to be substituted into the format string. The user'27s default locale is used for format information. s8 li7029 fi-5794 fi-6552 fs16 fs28 fi-6552 + (NSMutableString *)b stringWithCString:b0 (const char *)i zeroTerminatedBytes s9 li7030 fi-6553 fi-5796 i0 tab Returns a mutable string containing the characters in i zeroTerminatedBytesi0 , which must be null-terminated. Thei zeroTerminatedBytesi0 string should contain bytes in the default C string encoding. s8 li7029 fi-5794 fi-6552 fs16 fs28 fi-6552 + (NSMutableString *)b stringWithCString:b0 (const char *)i bytes s9 li7030 fi-6553 fi-5796 i0 b length:b0 (unsigned int)i lengthi0 tab Returns a mutable string containing i lengthi0 characters made from i bytesi0 . This method doesn'27t stop at a null byte. i bytesi0 should contain bytes in the default C string encoding. s8 li7029 fi-5794 fi-6552 fs16 fs28 fi-6552 + (NSMutableString *)b stringWithCapacity:b0 (unsigned int)i capacity s9 li7030 fi-6553 fi-5796 i0 tab Returns an empty mutable string, using i capacityi0 as a hint for how much initial storage to reserve. s8 li7029 fi-5794 fi-6552 fs16 fs28 fi-6552 + (NSMutableString *)b stringWithCharacters:b0 (const unichar *)i charactersi0 tab s9 li7030 fi-6553 fi-5796 b length:b0 (unsigned int)i lengthi0 tab Returns a mutable string containing i charactersi0 . The first i lengthi0 characters are copied into the string. This method doesn'27t stop at a null character. s8 li7029 fi-5794 fi-6552 fs16 fs28 fi-6552 + (NSMutableString *)b stringWithContentsOfFile:b0 (NSString *)i pathi0 tab s9 li7030 fi-6553 fi-5796 tab Returns a string containing the contents of the file specified by i pathi0 . This method attempts to determine the encoding for the file. The string is assumed to be in Unicode encoding, but if the encoding is determined not to be Unicode, the default C string encoding is used instead. s8 li7029 fi-5794 fi-6552 fs16 fs28 fi-6552 + (NSMutableString *)b stringWithFormat:b0 (NSString *)i format,... s9 li7030 fi-6553 fi-5796 i0 tab Returns a mutable string created by using i formati0 as a b printf()b0 style format string, and the subsequent arguments as values to be substituted into the format string. pard s16 li100 fi0 ri1007 ql f0 b fs48 fs28 Initializing a Mutable String fs14 fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} b initWithCapacity:b0 (unsigned int)i capacityi0 tab Initializes a newly allocated mutable string object, giving it enough allocated memory to hold i capacityi0 characters. pard s16 li100 fi0 ri1007 ql f0 b fs48 fs28 Modifying a String fs14 fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} (void)b appendFormat:b0 (NSString *)i format,...i0 tab Adds a constructed string to the receiver. The new characters are created by using i formati0 as a b printf()b0 style format string, and the following arguments as values to be substituted into the format string. Invokes b replaceCharactersInRange:withString:b0 as part of its implementation. fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b appendString:b0 (NSString *)i aStringi0 tab Adds the characters of i aStringi0 to end of the receiver. Invokes b replaceCharactersInRange:withString:b0 as part of its implementation. fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b deleteCharactersInRange:b0 (NSRange)i range s9 li7030 fi-6553 fi-5796 i0 tab Removes from the receiver the characters in i rangei0 . This method raises an NSStringBoundsError exception if any part of i rangei0 lies beyond the end of the string. Invokes b replaceCharactersInRange:withString:b0 as part of its implementation. s8 li7029 fi-5794 fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b insertString:b0 (NSString *)i aStringi0 tab Inserts the characters of i aStringi0 into the receiver, such that s9 li7030 fi-6553 fi-5796 b atIndex:b0 (unsigned)i indexi0 tab tab the new characters begin at i indexi0 and the existing character from i indexi0 to the end are shifted by the length of i aStringi0 . This method raises an NSStringBoundsError exception if i indexi0 lies beyond the end of the string. Invokes b replaceCharactersInRange:withString:b0 as part of its implementation. s8 li7029 fi-5794 fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b replaceCharactersInRange:b0 (NSRange)i aRange s9 li7030 fi-6553 fi-5796 i0 b withString:b0 (NSString *)i aStringi0 tab Inserts the characters of i aStringi0 into the receiver, such that they replace the characters in i aRangei0 . This method raises an NSStringBoundsError exception if any part of i aRangei0 lies beyond the end of the string. s8 li7029 fi-5794 fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b setString:b0 (NSString *)i aStringi0 tab Replaces the characters of the receiver with those in i aStringi0 . }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.