Objective-C/Cocoa Basics

Discussion in 'Mac Programming' started by mck9235, Feb 18, 2008.

  1. macrumors newbie

    Joined:
    Feb 18, 2008
    #1
    I'm trying to learn some of the basics of Cocoa by following along an Apple Developer guide. Currently, I have this Cocoa sample code that I want to run in XCode, but it simply won't let me build/run a single file.

    I don't want to create a whole project, just run a simple file! Any help is appreciated. :) Let me know if I wasn't descriptive enough on anything.

    Thanks
     
  2. macrumors 6502a

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #2
    The way Xcode works is that you'll have to create a New Project.
     
  3. macrumors 6502

    Joined:
    Jun 16, 2004
    #3
    Or you can compile with gcc.
    Code:
    gcc -framework Cocoa -o <output file> <input file>
    (Or something like that -- I'm not by my OS X machine to test)
    Not sure if this will work for applications with nibs, but for straight Obj-C + Cocoa it should. The O'Reilly "Objective-C Pocket Reference" explains exactly how to do it.

    EDIT: I got off of my *** and grabbed the book - I was wrong, I can't remember which book it was that explains it.
     
  4. macrumors member

    Joined:
    Nov 27, 2006
    #4
    I believe it's: gcc Filename(s) -o OutputFilename

    I think you mean Stephen Kochan's "Programming in objective-c". Also not sure on applications with nibs.

     
  5. macrumors member

    Joined:
    Nov 27, 2006
    #5
    I believe it's: gcc Filename(s) -o OutputFilename

    I think you mean Stephen Kochan's "Programming in objective-c". Also not sure on applications with nibs.

    Update: sorry got posted twice by mistake :s

     
  6. macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory

Share This Page