Source Code from good programmed Mac Applications?

Discussion in 'Mac Programming' started by mrtnbroder, Sep 18, 2013.

  1. mrtnbroder macrumors newbie

    Joined:
    Sep 18, 2013
    #1
    Hello!

    Since I learn alot at looking at other peoples source code (imo), I want to ask if someone knows some good open source applications where I can take a look around, how they are build and so on.

    I aswell can just say that the Adium-Source is abit overkill for me as a Objective-C newbie.

    Hopefully someone knows some smaller Applications ;)
     
  2. lloyddean macrumors 6502a

    Joined:
    May 10, 2009
    Location:
    Des Moines, WA
    #2
    The source for "TextEdit.app" is available as sample code at the MacDev Center.
     
  3. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #3
    Go here:
    https://developer.apple.com/library/mac/navigation/

    Enter sample code into the search box.

    The result will be a list of sample apps, tools, classes, etc.


    If you want sample code for a particular class, open the class reference doc (e.g. in Xcode documentation) and there should be links for sample code.

    The online class reference docs also have sample code links. For example:
    https://developer.apple.com/library...nsuserdefaults_Class/Reference/Reference.html

    There are 5 apps (including the aforementioned TextEdit) listed as Related Sample Code.


    If you haven't been reading Apple's class reference docs, you should. After you learn the basics of a class using a tutorial, you should always refer to the class reference doc, not only for additional methods, but because the class reference doc often has links to related classes that would overwhelm a tutorial context.

    One of the keys to learning how to program is to learn how to learn about programming. The ability to find and read reference docs is a crucial skill. In other words, have a strategy for discovery.
     
  4. mrtnbroder thread starter macrumors newbie

    Joined:
    Sep 18, 2013
    #4
    thanks alot chown33!

    Problem is, most of the Sample Code Applications only cover a specific topic. I was looking for more like that (TextEdit is a really good example!).

    I've already looked at the source code and found it very useful!
     
  5. robvas macrumors 68020

    Joined:
    Mar 29, 2009
    Location:
    USA
  6. devilofspades macrumors member

    Joined:
    Jul 20, 2011
    #6
    http://opensource.apple.com

    you can find lots of different apps & things here, many with xcode projects to check out. the one cavet is most "advanced" programs or libs are going to be complex and maybe difficult for a beginner to decypher. some stuff will even be in c or c++. the chess app included with os x is a perfect example.


    as others have said, the best place to start for sample code is the dev portal. unlike the other "production" open source stuff metioned abobe, the majority of this is highly documented and uses higher level api until you get to some "advanced" topics like quartz or opengl.
     

Share This Page