ボタンのクラスタを作成したいのですが、このようなループを使用しています。ループ内のボタンを作成し、各ボタンに特定のタグを割り当てる方法
for (int i =0; i< [plistArray count];i++) {
editButton = [[UIButton alloc]initWithFrame:CGRectMake(width-10, -3.6, 39, 35)];
[editButton setImage:[UIImage imageNamed:@"DeleteButton.png"] forState:UIControlStateNormal];
[editButton addTarget:self action:@selector(deleteObjectViewImage:) forControlEvents:UIControlEventTouchUpInside];
}
私は機能が割り当てられ、任意のランダムボタンをクリックしたときに私は(シーケンス1,2,3に)最初のボタンをクリックしたときに呼び出さcalled.Itされません。
はあなたが動的に画面上のボタンを追加しますか? – iMOBDEV