wou*_*_be 0 iphone button uibutton ios
之前我创建了很多按钮,但由于某种原因,我在创建一个简单的按钮时遇到了麻烦.
在我的viewDidLoad方法中,我创建了一个非常基本的按钮
_button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
_button.frame = CGRectMake(0, 0, 100, 25);
[_button addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:_button];
- (void)buttonClicked:(id)sender
{
NSLog(@"%@", sender);
NSLog(@"Download issue");
}
Run Code Online (Sandbox Code Playgroud)
但出于某种原因,当我点击它时,我只是得到一个错误
* - [DownloadButtonViewController performSelector:withObject:withObject:]:消息发送到解除分配的实例0x6ac2af0
我不知道出了什么问题,因为代码与我之前创建的每个按钮完全一样......(可能只是有一个糟糕的一天......)
| 归档时间: |
|
| 查看次数: |
1948 次 |
| 最近记录: |