Can you please tell me how can I set a global #define in my Xcode project?
I don’t want to put #define DEBUG in every .h of my project.
Thank you
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.
This is generally done in the Xcode project properties. Right-click on the project itself in the project window (the project is the top level of the heirarchy) and choose “get info”. This will bring up the project inspector window. In the inspector window, choose the “Build Settings” tab. Now, use the search field to find an entry called “preprocessor macros”, and put the string
DEBUGinto that entry.If you do this only for the “Debug” build configuration (there should be a drop-down menu within the project inspector window), then this
DEBUGmacro will only be #defined when you are actually debugging.See Apple’s documentation for all the dirty details.