Quick #include question


I get hung up on small things like this…i like understanding EVERYTHING.

If #import is “faster and more efficient” than #include, why would anybody even use #include in the first place? Why have we been using it at all/is it ever used by real developers?


It is used for backwards compatibility as if someone needed to compile your code on an older compiler it would not necessarily understand the import directive.


stackoverflow.com/questions/4396 … bjective-c

I was curious about this as well when I noticed the import command show up in an example a few chapters back. This stack overflow thread does a pretty good job of explaining the differences. Long story short: they are essentially equivalent the majority of the time.