PDA

View Full Version : Help With Xcode




Decriptic
Nov 23, 2009, 07:16 PM
I want to know if it is possible to make iPhone applications in C++ in Xcode. I know a few programming languages, but Objective-C is quite complicated. This is probably because I have started out with C++. So that is why I need to know if Xcode is capable of making C++ iPhone apps. Any help?

And if so can you tell me how?



dejo
Nov 23, 2009, 11:39 PM
Learn Objective-C. You'll be much better off. Sticking with one language because that's what you already know is only going to hurt you in the long run.

tutukun
Nov 24, 2009, 12:46 AM
I want to know if it is possible to make iPhone applications in C++ in Xcode. I know a few programming languages, but Objective-C is quite complicated. This is probably because I have started out with C++. So that is why I need to know if Xcode is capable of making C++ iPhone apps. Any help?

And if so can you tell me how?

you only need Obj-C to communicate with some part of the Iphone sdk. The actual code for your app can still be in C++
http://consultingblogs.emc.com/filthyria/archive/2008/09/03/using-c-with-objective-c-and-iphone-sdk.aspx


best example would a oolong game engine oolongengine (http://oolongengine.com/)
Its mostly written in C++

firewood
Nov 24, 2009, 02:26 AM
I want to know if it is possible to make iPhone applications in C++ in Xcode. I know a few programming languages, but Objective-C is quite complicated.

Objective-C is much less complicated than C++. Look at the size of the latest C++ specification.

The obvious difference to get over quickly is that the punctuation abuse being different.

And you can write most of an app in C++ except for the UI, since gcc is the compiler.

Decriptic
Nov 24, 2009, 07:42 PM
Thank you all, so all in all, the User Interface will have to be coded in Objective-C? And its not possible to change that?

firewood
Nov 25, 2009, 01:32 AM
There is no documented (and thus allowed) API for the UI (including windows, touch input and other events, etc.) except those in Objective C.

But any experienced programmer who isn't sharp enough to pick up the basics of Objective C in a few weeks probably isn't sharp enough to write a decent iPhone app anyway.

I suppose if you really wanted to be demented, you might be able to do it using very complicated plain C. An Objective C compiler could be written to output plain C plus a support runtime (the first Objective C compiler was reportedly implemented this way). So you could write C macros in the form of post-processed Objective C compiler output, and have those C macros call Apple's Objective C runtime/interpreter using introspection, etc. It might be up to 10X the lines of code and 1/10th as readable, and you would need to be an expert in the Objective C language and runtime to pull this off...

So, yes, it's possible. Have Fun!

fernandovalente
Nov 26, 2009, 12:49 AM
Yes you can, but you will need Objective-C for things such as recognizing touchs and accelerometer. You will need to do some research about Objective-C++.