xcode problem (no idea)

Discussion in 'Mac Programming' started by Billbobeany, Jan 7, 2011.

  1. Billbobeany macrumors newbie

    Joined:
    Aug 23, 2010
    #1
    Hi, Im starting to learn objective C so i can make apps for mac and iphone. In the book im working from its got a hello program. Ive copied it and checked it and checked it again but i cant see whats wrong. I open xcode(3.2.1 or what ever is the newest with out the subscription) I click cocoa app, then write the code in 'main.m' and write

    #import <Foundation/Foundation.h>

    int main (int argc,const char * argv[])
    {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    NSLog (@"Programming is fun!");

    [pool drain];
    return 0;
    }


    It comes up with something like 21555 errors. Please can some one tell me what im doing wrong. Ive been to nearly every apple store in the country and no one can help.
     
  2. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #2
    This isn't a cocoa app. In 3.2.4 at least it's a Command Line Tool -> Foundation. (In the second edition of the book it refers to this as Foundation Tool).

    B
     
  3. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #3
    Which book might that be? It's help if you can be specific.

    What country might that be? If it has lots of Apple Stores, please don't exaggerate. It doesn't help your plea.
     
  4. balamw, Jan 7, 2011
    Last edited: Jan 7, 2011

    balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #4
    It's Kochan's first example from Programming in Objective C 2.0.

    EDIT: Here's a link to a recent thread by someone who shares your frustration. http://forums.macrumors.com/showthread.php?t=1074141

    Note Kochan doesn't get into Cocoa until Chapter 20!

    Finally, you don't need to pay to register as a developer and get the latest release of Xcode. See this thread: http://forums.macrumors.com/showthread.php?t=1076150

    B
     
  5. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #5
    Post the text for the first of the 21555 errors.

    Pretend we can't see your screen, so anything you see there is invisible to us. That means you have to be specific, and give actual text from actual errors.


    You can see Xcode's version number by choosing "About Xcode" from the Xcode menu. Post the exact version number, and whether it's 64-bit or 32-bit.

    It may also help to identify what model your computer is.
     

Share This Page