#import 是什么意思?如果我们使用#include 会发生什么?
What is meaning of #import? if we use #include what happens?
为什么在 objective c 中使用#import?如果我们使用#include 会发生什么?
The #import directive was added to Objective-C as an improved version of #include. Whether or not it's improved, however, is still a matter of debate. #import ensures that a file is only ever included once so that you never have a problem with recursive includes. However, most decent header files protect themselves against this anyway, so it's not really that much of a benefit.
来源:@Jason Coco
为什么在 objective c 中使用#import?如果我们使用#include 会发生什么?
The #import directive was added to Objective-C as an improved version of #include. Whether or not it's improved, however, is still a matter of debate. #import ensures that a file is only ever included once so that you never have a problem with recursive includes. However, most decent header files protect themselves against this anyway, so it's not really that much of a benefit.
来源:@Jason Coco