Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to use only C++ to create iOS apps? Is there any downside to that? I read somewhere that you have to use a mix of objective C and C++ if you want to use C++ that bad.

share|improve this question

closed as unclear what you're asking by gnat, MichaelT, Kilian Foth, BЈовић, ChrisF Jun 25 '13 at 21:32

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

Bit late but there's also Dragonfire SDK, that's programmed in C++. – David Bolton Jun 19 '13 at 7:11
up vote 6 down vote accepted

I'll add a bit more color to the explanation given by Paul above.

There are two main areas where you must interface your c++ with ObjC to make a functional app:

  • You must interface with the runloop provided by UIKit to receive event notifications such as touches and app state changes.

  • To display content on screen, you need to either wrap UIKit / CoreAnimation or provide content via the EAGL / GLKit apis (OpenGL ES).

If you want access other capabilities of the device, they're typically only provided via an ObjC api, though sometimes they are also available at a lower level with a C API (such as audio and the address book).

In general, I tend to make most of the app ObjC, but then use C++ to help with the efficient implementation of some subsystems. In general, modern ObjC plays very well with C++ as they use both internally at Apple.

share|improve this answer

For the user interface on iOS you need objective C, for the remainder you can use C++. Wether or not using C++/Obj C and not pure objective C depends primarily on your C++ skills. If you are already fluent in C++, doing part of the development in that might pay off. If not, going for pure obj C is probably a better choice. See also

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.