Options for a C programmer

Discussion in 'iOS Programming' started by PoppingCorn, May 7, 2010.

  1. PoppingCorn macrumors newbie

    Joined:
    May 7, 2010
    #1
    Hi, i was wondering if you guys could give me all the different options i have for writing apps for the iphone/ipad, using plain old :p C. Like at the moment i've only make programs for the mac os x, using both carbon, cocoa. And i find i prefer sticking with just C not having to delve into objective-C to set up my interface. That's why i prefer using carbon over cocoa, so this is why i was wondering what are my options for the iphone/ipad.
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    There is no Carbon on the iPhone and to all intents and purposes it's dead for GUI-level programming on Mac OS as well. Your only native GUI option for the iPhone is to learn Objective-C.
     
  3. PoppingCorn thread starter macrumors newbie

    Joined:
    May 7, 2010
    #3
    Damn, oh well guess i'll just have to put up with it :p.

    What about OpenGL ES, i'll still need to create the user interface with objective-C right? But for implementing the OpenGL ES functions and features i can do that in C, or will that also have to be in objective-C?
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    If you want absolutely everything in OpenGL ES then you'd need a very minimal amount of Objective-C to setup the window and view and potentially deal with touches and rotation events. If you want native buttons (instead of your own in OpenGL) then you'll need some more Objective-C.

    I don't think Apple have wrapped OpenGL ES in any real CocoTouch wrapper. Sure it's a UIView but the interface to OpenGL looks (as far as I've looked which is not far) like the pure-C OpenGL I used back at Uni.
     
  5. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #5
    The UIKit user interface is all object oriented. There is no other legal option (e.g. supported/documented APIs).

    So you have to learn OOP and event driven methodology.

    While it is theoretically possible to write an OOP UIKit app all in C (by calling all the selectors through a bunch of the Objective C Runtime wrapper functions), it's 100X messier and longer than just writing all the calls and callbacks in Objective C.

    So bite the bullet and learn enough Objective C to do a simple view app.
     

Share This Page