views:

179

answers:

4

Hi all

Can I write applications for iPhone in C++ or C#? Where can I find simulators for iPhone for testing my apps. How to write them?

A: 

You can use C, Obj-C, and C# (via MonoTouch).

C++ is a partial via Objective-C++. If you're serious about iPhone development though, I would suggest learning Objective-C.

Apple seems to reserve the right to kill the ability to run any application that wasn't writting in either C or Objective-C.

Justin Niessner
You can have code modules in C and C++, too. You don't need to be Objective for all of your code. (I've got some straight C, some C++, some Obj-C, and very little Obj-C++ that I've been moving away from.)
dash-tom-bang
@dash-tom-bang - I was under the impression that some of the OO aspects from C++ didn't work on the iPhone (since Apple wants you to stick to Obj-C). Does the full C++ spec actually work?
Justin Niessner
I detest RTTI and exceptions so have never tried those. In a many-languages application they'd probably be suspect anyway. I did have some trouble, but I don't remember what, doing "advanced" C++ inside of Objective-C++ files, but straight C++ (.cpp, not .mm) files supported whatever I was throwing at them.
dash-tom-bang
A: 

As far as I know, you can use C# for the iPhone using MonoTouch.

Another tool is unity, which is geared towards games and is based on the same codebase.

Both of these are proprietary and cost $$$.

Oded
+5  A: 

You need at least a small Objective C stub to hook into the system and deal with provided services (including getting input), but your program can be primarily in C++ if you would like. Apple seems to disallow C#; tools such as MonoTouch appear to be banned by the current developer agreement.

With a Macintosh, you go to Apple's developer website and download the tools and SDKs for free. They only run on the Mac.

dash-tom-bang
@dash-tom-bang - MonoTouch was given the green light by Apple.
Justin Niessner
Oh wow. That's surprising. (Answer updated.)
dash-tom-bang
Source? I heard the ban, but haven't heard it re-allowed.
Robaticus
http://www.zdnet.com/blog/burnette/how-monotouch-gets-around-apples-vm-restrictions/1738 ...and other articles from the MonoTouch team.
Justin Niessner
OK thanks dash-tom-bang, it's very nice that I can develop iPhone apps in C++. Please provide more information about "how to start my first iPhone application". Where can I find simulators and information like that. Thanks again
Davit Siradeghyan
In that zdnet application they conclude with the statement that Adobe has a similar system for Flash, which it seems that Apple is intent on disallowing. If I were to develop an iPhone app using MonoTouch, I would do so being fully aware that Apple may not allow distribution of the application, or may yank it at any date if it made it to the App Store.
dash-tom-bang
I can't really provide information on that. I mean, you install their compiler and then look at their source code and then start writing code. Add .c or .cpp files to the project and they "Just Work."
dash-tom-bang
+1  A: 

You will want to start here for iPhone development:

http://gemma.apple.com/iphone/index.action

This is where you will get the iPhone SDK, simulator, and other essential tools.

bentsai