exit code 1

Discussion in 'iOS Development' started by Tupac08, Oct 18, 2009.

  1. Tupac08

    Tupac08 Member

    Joined:
    Jan 15, 2009
    Messages:
    32
    Likes Received:
    0
    Device:
    iPhone 4 (Black)
    I am receiving an error which reads:
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

    Here is The code:​
    #import "MainView1.h"

    @implementation MainView

    @synthesize MyButton, MyButton2;

    - (IBAction)buttonclick {
    MyButton=@"Skeleton";

    }

    - (IBAction)buttonclick2 {
    MyButton2=@"Back";


    }
    @end

    Thanks in advance
  2. Axis

    Axis Super Moderator Staff Member

    Joined:
    Dec 2, 2007
    Messages:
    6,288
    Likes Received:
    133
    Device:
    iPhone 4S (White)
    Of what class is "MyButton"? If its a UIButton, as the name suggests, you can't set it to a string literal. You need to [setTitle:forState].

    Also, you violate naming conventions by giving an object a name that begins in a capital letter.
  3. Collateral

    Collateral Active Member

    Joined:
    Sep 23, 2007
    Messages:
    1,974
    Likes Received:
    6
    Device:
    iPhone 3GS (Black)
    I believe you can also use
    [OBJC] #import "MainView1.h"

    @implementation MainView

    @synthesize MyButton, MyButton2;

    - (IBAction)buttonclick {
    MyButton.text = @"Skeleton";

    }

    - (IBAction)buttonclick2 {
    MyButton2.text = @"Back";


    }
    @end;[/OBJC]

    thats what i think the syntax is at least.. my objc isnt the greatest.

    Ps. Axis is right about the naming though
  4. NolesFans

    NolesFans New Member

    Joined:
    Sep 23, 2008
    Messages:
    404
    Likes Received:
    0
    Device:
    iPod touch
    Another hint, IBAction is just void.

Share This Page