Error in Apple example documentation?

Discussion in 'iOS Programming' started by thomasjt, Jul 7, 2009.

  1. thomasjt macrumors newbie

    Joined:
    Apr 16, 2009
    #1
    Hi,

    I was having some problems with initialising an NSMutableDictionary so I turned to the documentation. There, I found this example:

    Code:
    NSDictionary *dict = [[NSDictionary alloc] initWithObjectsAndKeys:@"value1", @"key1", @"value2", @"key2", nil];
    which I then tried to compile. I got the following error - the same one as the error I was getting for my code:

    Any ideas what's going on?

    Cheers,

    Tom
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    Where are you calling this code? If it's outside of a method in your @implementation block, you'll get this error.
     
  3. thomasjt thread starter macrumors newbie

    Joined:
    Apr 16, 2009
    #3
    Oh wow I suck, it was outside of a method. Thanks so much for your help.

    Tom
     

Share This Page