1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Obj-C + Cocoa

Discussion in 'Mac Programming' started by Nsutton, Jul 5, 2010.

  1. macrumors member


    I just started learning Objective C today and It will be my third programming language (Python,C#).

    I'm kinda confused about the whole cocoa thing. I know it a apple api for objective C but what does it add to the core language?
    Does it change the syntax at all or require extra learning to use it?
  2. macrumors 68030


    Objective-C is an extension to C that adds its own syntax for dealing with objects.

    When programming on the Mac or iPhone platform there are quite a few "bonus" classes that you have access too, such as collection classes and strings/parsing.

    Cocoa in the strictest sense is the graphical frameworks for laying out windows, buttons, text views, et'cetera...

    The syntax is the same, but there are some paradigms to learn and love. Model-View-Controller being the biggest.
  3. macrumors 6502a


    This is incorrect. Cocoa includes not only App kit (which is what you're describing above) but also the Foundation Framework which includes all of the non-graphical classes (NSObject, NSString, NSArray etc.). I hate to split hairs, but you did say "strictest sense," so I'm being persnickety.

    Here's a link to the relevant documentation.
  4. macrumors 68030


    You are correct. I guess Apple muddied the water when the iOS's version of Cocoa is called Cocoa Touch although the vast majority of the underlying Foundation level frameworks are the same or at least very similar, but the hither level frameworks for things like buttons or table views are completely different. I guess because of that I've always considered Cocoa as being the graphical frameworks.

    In a lot of ways then, practically anything you use in Objective-C is Cocoa. Though Objective-C is available on other platforms, you don't get any of the useful classes.
  5. macrumors newbie

    The GNU project has implemented many of those useful classes in the open-source and portable GNUStep.

Share This Page