learning to code for iPhone

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

  1. Rdrnatn24 macrumors newbie

    Jan 7, 2008
    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

    Oct 26, 2007
    [[NSLocation alloc] initWithCity: Chicago]
    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


    Jan 6, 2004
    Western US
    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

    May 12, 2003

    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


    Jan 10, 2005
    Dallas, TX
    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.

  6. Monkaaay macrumors 6502


    Jun 19, 2006
    Richmond, VA
    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

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

Share This Page