Course Highlights:
- Differences between C-language strings and OC language strings
- The difference between a class method and an object method
- Understand the differences between nsstring (mutable strings) and nsmutablestring (immutable strings)
- NSString (Immutable string)
- nsmutablestring (variable string)
- Discrimination between NSString and nsmutablestring use
Differences between C-language strings and OC language strings
// in the C-language phase we define a string variable in the following format:
char// char is the data type of the character, CString is the variable name, * is a pointer, where he plays the role is, represents CString is a string variable // the format of defining a string variable in the OC phase is the same /// However at this point NSString is no longer called a data type in OC, but is called a class, Ocstring is no longer called a variable name but is called an object. * This is still a pointer, which represents the declared object is the NSString type.
PS: In C we say that the string is actually an array, and the array contains each character in the string. In OC, each string object is indeed a string.
String
#pragma mark----------Understand the difference between nsstring (immutable strings) and nsmutablestring (mutable strings)-----------
#pragma mark------------------nsstring (immutable string)----------------
#pragma mark to create a string constant
#pragma mark to create a formatted string heap area
#pragma the mark string comparison
#pragma the conversion of the Mark string
Interception and splicing of #pragma mark string
#pragma mark---------nsmutablestring (variable string)------
PS: All of the previous operations on NSString (immutable strings) We are all processing the entire string, unable to make a single string to be added to the operation of the check. Now let's use nsmutablestring (variable string) for additional
#pragma Mark added
#pragma mark Delete
#pragma mark changed
#pragma mark.
oc-2-string