以前はたくさんのボタンを作成しましたが、どういうわけか簡単なボタンを作成するのに苦労しています。
私の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");
}
しかし、何らかの理由でそれをクリックすると、エラーが発生します
* -[DownloadButtonViewController PerformSelector:withObject:withObject:]:割り当て解除されたインスタンス0x6ac2af0に送信されたメッセージ
コードは以前に作成したすべてのボタンとまったく同じであるため、何が問題になっているのかわかりません...(おそらく悪い日を過ごしているだけです...)