title: Debugging iphone app
body: <p>How do I debug an iPhone aplication? How can I find out what's going on in the simulator? I'm a beginner in Xcode development and don't know what's the problem with the code below. The app is crashing on button click.</p>
  
  <pre><code>- (void)viewDidLoad {
  
      myLabel = [[UILabel alloc]init];
  
      [myLabel setText:@"Labela"];
      myLabel.frame = CGRectMake(50.0,50.0, 100.0, 30.0);
      [self.view addSubview:myLabel];
  
      myButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
  
      [myButton addTarget:self 
                   action:@selector(buttonAction:)
         forControlEvents:UIControlEventTouchDown];
  
      [myButton setTitle:@"Klikni" forState:UIControlStateNormal];
      [myButton setFrame:CGRectMake(80.0, 210.0, 160.0, 40.0)];
  
      [self.view addSubview:myButton];
      [super viewDidLoad];
  
  }
  
  - (void)buttonAction {
      [myLabel setText:@"Promijenjen!"];
  }
  </code></pre>