0%

MacOSX import的定义

import is a feature provided by the GCC compiler, which is what Xcode uses when you’re compiling Objective- C, C, and C++ programs. #import guarantees that a header file will be included only once, no matter how many times the #import directive is actually seen for that file.

NOTE

In C, programmers typically use a scheme based on the #ifdef directive to avoid the situation where one file includes a second file, which then, recursively, includes the first.

In Objective- C, programmers use #import to accomplish the same thing.

So import equals to ifndef plus include.

处无为之事,行不言之教;作而弗始,生而弗有,为而弗恃,功成不居!

欢迎关注我的其它发布渠道