tags:

views:

719

answers:

3

Does anyone know where or how to obtain a C++ example to create iPhone apps? What I am looking for is just using C++ (no objective-C or just the bare essential objective-C) and no interface builder, source only.

Can ayone help me locate such a beast?

A: 

I do not think that exists friend. Its only objective C.

Maybe you could get something to translate your C++ into objective-C.

Dinoo
You can mix Objective-C with C++. But I'd advise against looking for a translator of some sort: you're unlikely to find one, and if you want old C++ code in Objective-C, you should either rewrite it or wrap it.There's really nothing wrong with mixing C++ and Objective-C.
Jonathan Sterling
And my unexperienced hands strike again. Will refrain from answering from now on :D
Dinoo
+3  A: 

You can use C++ and objective-c together, there are some docs in Apple's developer guides. You just need to change the file extensions over from .m to .mm.

You still need to be a registered iPhone developer with Apple to do this however, as you need the SDK to link against.

Khanzor
The `.h` can stay being `.h`. It's just the `.m` needs to become `.mm`.
KennyTM
With more emphasis: `.hh` is plain wrong.
Jonathan Sterling
Whoops, should've actually looked at the docs.
Khanzor
+1  A: 

You can download Carmack's source for Wolfenstein3D for the iphone to see what a program that only uses the minimum of Objective-C necessary to run looks like. He uses C mixed with Objective-C in this case ,but as everyone has mentioned, there's no way to avoid using some Objective-C if you plan on linking against the iPhone SDK.

daveangel