如何调试iPhone应用程序?我怎样才能知道模拟器中发生了什么?我是Xcode开发人员的初学者,不知道下面的代码有什么问题。该应用程序在点击按钮时崩溃。调试iphone应用程序
- (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!"];
}