Cho đến nay, tôi đã sử dụngLàm cách nào để thay thế hành động hiện tại của một (?) UIButton?
[button1 addTarget:self action:@selector(newAction) forControlEvents:UIControlEventTouchUpInside];
mà thêm một hành động bổ sung (tôi nghĩ). Làm cách nào để thay thế hành động ban đầu bằng hành động mới?
Tôi nghĩ rằng UIButton có thể chấp nhận được, có. –
nó âm thanh tốt hơn rất nhiều – androidnotgenius
Để loại bỏ tất cả các hành động trước đó: '' '[button1 removeTarget: nil hành động: NULL forControlEvents: UIControlEventAllEvents]' '' - xem http://stackoverflow.com/questions/3340825/uibutton-remove-all -target-actions –