Can’t I leave out #import “foo.h” in .m file if it’s already in the prefix header?
The product still builds successfully when I leave it out. But, I’ve noticed that the Xcode templates keep them in. Why?
Is the answer the same for #include?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t know why it does this, but it doesn’t hurt because
#importprotects from double#includeby checking if something is already#import-ed or#include-d, so no, the same scenario wouldn’t work with #include.