我有这段代码,它对我不起作用并产生运行时错误
-(void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
myButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
//position button
myButton.frame = CGRectMake(50, 50, 50, 50);
[myButton setTitle:@"\u2606" forState:UIControlStateNormal];
// add targets and actions
[myButton addTarget:self action:@selector(myButtonClicked) forControlEvents:UIControlEventTouchUpInside];
// add to a view
[self.view addSubview:myButton];
}
-(void)myButtonClicked{
[myButton setTitle:@"\u2605" forState:UIControlStateNormal];
}
我从这个网站得到了这个,但找不到删除这个运行时错误的方法。谢谢