C, Objective-C preprocessor output

4 Solutions Collect From Internet About “C, Objective-C preprocessor output”

On the command line, gcc -E foo.m will show you the preprocessed output (just as it does for normal C/C++ files). Of course, this will also expand any #include or #import statements you may have in your code.

From within Xcode:

  • Xcode 3: Select the file, then Build → Preprocess.
  • Xcode 4: Select the file, then Product → Generate Output → Generate Preprocessed File.

Use the -E command-line argument to gcc or clang. This is documented as: “Preprocess only; do not compile, assemble or link” and indeed it outputs the preprocessed version to stdout.

In Xcode 5: Select the .m file, then Product -> Perform Action -> Preprocess “.m”