Just wondering -
When you start to type #import "
Xcode suggests .m
files and .h
files. I just had a few hours of frustration after mistakenly importing .m
file.
Is that a bad design? Can you import .m
files?
You can import any files. #import
is just a preprocessor directive that basically says "include contents of the file I tell you into the current file". There are some include guards as well, but the import does just that - it imports the file you tell it to.
Importing the header with .h file is probably more of a convenience/convention (please don't beat me for this, I'm just guessing) unless there's some C/C++ standard that says otherwise.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With