NSString
Represents a string class in OC
%@ is the format character for objects in OC
printf cannot print objects in OC
By stringWithFormat: This class method, print the formatted string
Cases
int a = 10;
NSString * str = [NSString stringwithformat:@ "height is%i", a];
NSLog (@ "%@", str);
Calculates the length of a string by the method of seeking length in the nssting
The method of seeking length in OC, when printing, is in the character units of each country. A space is also a character
Example unsigned long OcL = [str length]; Length count character lengths
BOOL
The return value of type bool, the method name is usually preceded by the IS
The bool return value Yes,no either Yes 1, otherwise NO is 0.
OC Multi-File development
implement code with multiple files to increase readability and improve programming efficiency
Define a class divided into 2 files:. h files,. m files
. h file: A declaration of a member variable, method
. m file: implementation of a method
To use a class, you need the. h file for the #import class.
Objective-c (NSString, BOOL, multi-file development)