learning to code for iPhone

Discussion in 'Mac Programming' started by Rdrnatn24, May 1, 2008.

  1. Rdrnatn24 macrumors newbie

    Joined:
    Jan 7, 2008
    #1
    I want to learn how to make programs using the iPhone sdk, mostly for a hobby (unless i make something good enough for the app store). I know c, c++, and assembly fairly well. What do you guys recommend my first step should be? Should a learn another languague before I learn the iPhone language (cocoa I think, right?)? Thanks for any help.
     
  2. iphoneGuy macrumors member

    Joined:
    Oct 26, 2007
    Location:
    [[NSLocation alloc] initWithCity: Chicago]
    #2
    Just download the SDk and dive into the samples... It is pretty easy to get running quickly. THey have done a lot to help developers with the samples....
     
  3. HiRez macrumors 603

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #3
    Cocoa is the API, Objective-C is the language, and yes you will need to know both to program for the iPhone. Objective-C is easy if you already know C and C++. Actually the iPhone API is somewhat different from the Cocoa API used in Mac desktop applications, though very similar and exactly the same for a large subset.

    Cocoa is two pieces: Foundation, which is low-level stuff non-UI stuff like strings, collections, networking, etc., and AppKit, which is all the higher-level UI stuff like views, window controllers, buttons, document management, etc. As far as I understand it, the iPhone basically works pretty much with all of Foundation, but has a replacement for AppKit called UIKit, which again is similar but has some differences (for one example, how to deal with multitouch events). So learning Cocoa with Mac desktop applications would certainly not be a bad way to get there, although you could just jump to iPhone coding directly.

    But bottom line is you will need to learn Objective-C first. Apple has a pretty good PDF available on its dev site which will get you up to speed with that, then just start reading the documentation.
     
  4. therevolution macrumors 6502

    Joined:
    May 12, 2003
    #4
    http://developer.apple.com/iphone

    Sign up for a free ADC account. Download the SDK and check out the tutorials and sample code.

    The language is Objective-C. Cocoa is not a langugage, it's the collection of libraries and classes that you use to create Mac applications. Cocoa Touch is the equivalent set of libraries for iPhone app development.
     
  5. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #5
    The heirarchy is:
    Objective-C (language)
    |->Cocoa (API)
    |-->iPhone SDK

    It might not be strictly necessary to have a strong cocoa background before diving into the SDK, but knowing the syntax of Objective-C is probably a good idea. It would be best to know things about the object definition, instantiation, and member invocation syntax before you dive in.

    -Lee
     
  6. Monkaaay macrumors 6502

    Monkaaay

    Joined:
    Jun 19, 2006
    Location:
    Richmond, VA
    #6
    With a strong C/C++ background, you'll be golden. Picking up Objective-C should be trivial for you.
     
  7. Rdrnatn24 thread starter macrumors newbie

    Joined:
    Jan 7, 2008
    #7
    Thanks for all the replys. Looks like i have some objective-C tutorials to read.
     

Share This Page