Can I do iPhone apps in C?

Discussion in 'iPhone/iPad Programming' started by PowerFullMac, Nov 12, 2008.

  1. macrumors 601


    Oct 16, 2006
    ...Or is it only Objective-C?
  2. macrumors 6502a

    Oct 24, 2008
    I suppose technically you could; Objective-C is a "strict superset" of C, meaning that any C you write will compile quite happily.

    However, by doing so you're basically shooting yourself in the foot. For the most part it's a very simple addition, and if you know C already then you'll have no trouble. Also, in order to have access to the SDK libraries (i.e. to actually do anything) you're going to need to use Objective-C.

    Here's a very nice (and short) primer on Objective-C:
  3. thread starter macrumors 601


    Oct 16, 2006
    OK then, well I am learning C now simply because it will allow me to do a lot. After learning it I will read the Objective-C one, if its really that simple theres no problem.

    Success and riches here I come :p
  4. macrumors 603

    Jul 29, 2003
    Silicon Valley
    Objective-C is a wrapper (translator and object runtime) around C. You can write most of an app in plain C, but can only interface with the iPhone UI using Cocoa, which can only be called using Obj-C. In the general case, you can't get any user input except that which is sent to an Obj-C object, and can't do any display drawing except when an Obj-C object is called. The rest of the app can be written in C if you want.

    I have some apps which are almost all C, except for a few files which do the Cocoa UI glue.


Share This Page