Getting started on iPad programming C, C++ or Objective C

Discussion in 'iOS Programming' started by Cabbit, May 2, 2010.

  1. Cabbit macrumors 68020

    Cabbit

    Joined:
    Jan 30, 2006
    Location:
    Scotland
    #1
    Hi there i am about to get started learning to program for the iPad, my previous experience is in Ruby, PHP, Visual Basic, Basic and a little Java.

    Just by a finger count i have 20 books on C and 30 on C++ so if you recommend one it's possible i have it.

    Now what i am wanting to know is if i am programming for a iPad is it only Objective C or is it a mix of Objective C and C, i also notice Apple says C++ programs are supported so would a grounding in C and C++ helm me learn Objective C and get me started on my first iPad application?
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Unless you are absolutely married to C++ I'd forget it. Even if you are using C++ you still have to write Objective-C to interface with the GUI components: there is no C++ interface. Also a lot of the system frameworks only provide Objective-C or pure C interfaces...
     
  3. Cabbit thread starter macrumors 68020

    Cabbit

    Joined:
    Jan 30, 2006
    Location:
    Scotland
    #3
    So if i want to get started with it should i start with C then learn Objective C once i have a grasp of C?
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    Yes. Make sure you understand what pointers are and the basics of flow control in C. Then you are in a good position to learn Objective-C. Remember in Objective-C you are using a perfect superset of C: any valid C is also valid Objective-C.
     
  5. EddyP macrumors 6502

    Joined:
    Feb 12, 2010
    #5
    I am using this book:
    http://www.amazon.com/dp/0321566157/?tag=10.03.10-20

    I learned some C++ years ago. That's all I know from the "C family".

    The author of the above book specifically recommends NOT learning C first. The book assume no prior knowledge of Objective C.
     
  6. larkost macrumors 6502a

    Joined:
    Oct 13, 2007
    #6
    When programming in C vs. Objective-C you really focus on different parts of the C specification. Because of the way the Obj-C runtime handles memory you don't really have to deal with it in the same way at all in day-to-day Obj-C programming (assuming you are not touching CoreFoundation, or other straight-C stuff).

    However, if you don't learn C you are going to run into some real problems from time to time, for example you occasionally need to know what pointers really are. These bits are going to be mystifying when you run into them unless you know C. You can go back and learn them, so you can probably do it in either order. Learning Obj-C first is probably going to feel like you are making quicker progress.
     
  7. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #7
    You can write apps in a mix of C and Objective C. The mix is up to you, except that it's a ton easier to do any iPhone UI using Objective C.

    Newbies tend to try and write even low-level code in Obj C syntax. High performance game engine and audio developers tend to write in straight C with a very thin Obj C wrapper.
     
  8. EddyP macrumors 6502

    Joined:
    Feb 12, 2010
    #8
    Thanks to all of the "voices of experience" here. I'm just getting going with Objective C. I appreciate the input about C vs. Obj C.

    Thank you!
     
  9. flyingturtle macrumors regular

    Joined:
    Apr 7, 2010
    #9
    I agree. Probably concentrate on Objective-C and then later you can learn C. I had to brush up on my C (it's been more than 15 years) after and during my learning of Objective-C.
     

Share This Page