0

How can I "compile" Objective-C Code to (only) C-Code?
There is a way to preprocess Objective-C in Xcode (Product -> Generate Output -> Generate Preprocessed File), but this is not what I'm looking for...

Thanks...

4
  • 2
    you are aware of that objc and c are completely different languages right? Commented Apr 17, 2012 at 22:40
  • Yes, but i meant the Objective-C code is converted into C... Or not? Commented Apr 17, 2012 at 22:44
  • if there was a tool that could convert between very different languages by just pushing a button (from object orientated to non-oo etc) I would be out of work Commented Apr 17, 2012 at 22:46
  • 2
    This is a perfectly valid question. In fact, the original version of Objective-C was nothing more than a pre-compiler that spit out straight C code and a small runtime that went with it. Commented Apr 17, 2012 at 22:50

1 Answer 1

3

clang (the compiler front-end used by Xcode nowadays) has a -rewrite-objc option built-in, which allows you to generate C++ code based on Objective-C (or Objective-C++) code.

Just don't ask me how to combine that with Xcode.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.