iOS Basics-01

1. OC is opposite to C

a. A small part of object-oriented syntax is added based on C.
b. Encapsulate C’s complex, cumbersome, and hateful syntax in a simpler way.
c.OC is fully compatible with C language.

2. The suffix name of the source file of the OC program is .m. m represents Message, which represents the most important mechanism in OC -> message mechanism.

The suffix of C language is .c

3. The main function is still the entrance and exit of the OC program.

The return value of type int represents the result status of the program.
Parameters of the main function: You can still receive data passed by the user to the program when running the program.
Parameters can also be omitted

4. #import directive
a. Starting with # sign is a preprocessing instruction.
b. Function: It is an enhanced version of the #include directive. It copies the contents of the file to the place where the directive is written during pre-compilation.
c. Enhancement: No matter how many times you #import the same file, it will only be included once.

If the #include directive wants to achieve this effect, it must be implemented in conjunction with the conditional compilation directive.
When the #import instruction includes a file, the bottom layer will first determine whether the file is included. If it is included, it will be skipped, otherwise it will be included.

5. Framework
a. It is a function library. Apple or a third party has written in advance some functions that are often used when developing programs.

Encapsulate these functions into classes or functions. The collection of these functions and classes is called a framework, which is a bit like a function library in C language.

b.Foundation framework

Foundation is basic. This framework provides some of the most basic functions to input and output some data types.
Foundation.h file contains all other header files in the Foundation framework.
So as long as we include Foundation.h, it is equivalent to including all the header files in the Foundation framework. Then all functions and classes in the Foundation framework can be used directly

Guess you like

Origin blog.csdn.net/X_King_Q/article/details/107633600
ios