NSString, Nsmutablestring, NSNumber (Basic data Type wrapper class), Nsvalue (special type wrapper class: pointer, array, struct), Nsarray, Nsmutablearray, Nsdectionary, Nsset and so on.
<2> Create a string from a class method: + (nsstring*)stringwithstring: (NSString *)
<6> Create a string by file:-(nsstring*)Initwithcontentsoffile:(nsstring *path) usedencoding: (Nsuinteger) Error: (nserror*) <7> creating strings from network data:+ (nsstring*)Stringwithcontentsofurl:(nsurl*) Encoding: (nsstringencoding) Error:(nserror*)
-(const void *) utf8string; 5. Variable string nsmutablestring (add, delete, change, check) <1> Create a variable array of fixed capacity
+ (ID) stringwithcapacity: (Nsuinteger) capacity;
<2> Insert content at index
-(void) insertstring: (NSString *) astring Atindex: (nsuinteger) Loc;
<3> Delete Content
-(void) Deletecharactersinrange: (nsrange) range;
<4> Add content (add at trailer)
-(void) appendString: (NSString *) astring;
-(void) AppendFormat: (NSString *) format, ... (ns_format_function);
<5> fully set to other strings
-(void) setString: (NSString *) astring;
<6> replacement
-(void) Replacecharactersinrange: (nsrange) Range withstring: (NSString *) astring;
Second, NSNumber class
(1) wrapping a basic data type as a class type that is a basic data type wrapper class
-(ID) Initwithchar: (char) value;
-(ID) Initwithunsignedchar: (unsigned char) value;
-(ID) Initwithshort: (short) value;
-(ID) Initwithunsignedshort: (unsigned short) value;
-(ID) initwithint: (int) value;
-(ID) Initwithunsignedint: (unsigned int) value;
-(ID) Initwithlong: (long) value;
-(ID) Initwithunsignedlong: (unsigned long) value;
-(ID) Initwithlonglong: (Long long) value;
-(ID) Initwithunsignedlonglong: (unsigned long) value;
-(ID) initwithfloat: (float) value;
-(ID) initwithdouble: (double) value;
-(ID) Initwithbool: (BOOL) value;
+ (NSNumber *) Numberwithchar: (char) value;
+ (NSNumber *) Numberwithunsignedchar: (unsigned char) value;
+ (NSNumber *) Numberwithshort: (short) value;
+ (NSNumber *) Numberwithunsignedshort: (unsigned short) value;
+ (NSNumber *) Numberwithint: (int) value;
+ (NSNumber *) Numberwithunsignedint: (unsigned int) value;
+ (NSNumber *) Numberwithlong: (long) value;
+ (NSNumber *) Numberwithunsignedlong: (unsigned long) value;
+ (NSNumber *) Numberwithlonglong: (Long long) value;
+ (NSNumber *) Numberwithunsignedlonglong: (unsigned long long) value;
+ (NSNumber *) Numberwithfloat: (float) value;
+ (NSNumber *) Numberwithdouble: (double) value;
+ (NSNumber *) Numberwithbool: (BOOL) value;
(2) After the packaging of the class data to be removed from the original type
-(char) charvalue;
-(unsigned char) unsignedcharvalue;
-(short) shortvalue;
-(unsigned short) unsignedshortvalue;
-(int) intvalue;
-(unsigned int) unsignedintvalue;
-(long) longvalue;
-(unsigned long) unsignedlongvalue;
-(long long) longlongvalue;
-(unsigned long long) unsignedlonglongvalue;
-(float) floatvalue;
-(double) doublevalue;
-(BOOL) boolvalue;
Third, Nsvalue class
(1) Wrapping a special basic type as an object (for example, struct, array, pointer)
a.//wrapping an array as a class type
+ (Nsvalue *) Valuewithbytes: (const void *) value objctype: (const char *) type;
or + (Nsvalue *) Valuewithpointer: (const void *) pointer;
Remove array type
-(void *) Pointervalue;
b.//wrapping the pointer as a class type
+ (Nsvalue *) Valuewithpointer: (const void *) pointer;
Remove pointer type
-(void *) Pointervalue;
c.//wrapping a struct as a class type (structure commonly used in Foundation: nsrange\nsrect\nssize\nspoint)
First, create the struct: (x, Y is the coordinate origin).
Nsrange range = Nsmakerange (location,length)
Nsrect rect = nsmakerect (x, y, width, height)
Nsrange size = nsmakesize (width,height)
Nsrect point= nsmakepoint (x, y)
Use a struct as a parameter
+ (Nsvalue *) Valuewithrange: (nsrange) range;
+ (Nsvalue *) Valuewithpoint: (nspoint) point;
+ (Nsvalue *) Valuewithsize: (nssize) size;
+ (Nsvalue *) Valuewithrect: (nsrect) rect;
Remove structure Type
-(Nspoint) Pointvalue;
-(nssize) Sizevalue;
-(Nsrect) Rectvalue;
-(Nsrange) Rangevalue;