如何調試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!"];
}