全て:
i) タイトルが Count のボタンを無効にしようとしています ii) そのタイトルを Busy に変更し、デルタ秒の遅延の後 iii) ボタンを有効にして iv) そのタイトルを Count に戻します
これはすべて、UIButton のアクションのコードで発生するはずです。
手順 i) から iii) は実行できますが、手順 iv) は機能しません。
[sender setEnabled:NO]; // the button is now disabled, clicking on it has no effect
[sender setTitle:@"Busy ... " forState:UIControlStateDisabled];
// wait delay seconds before reenabling the count button
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delta * NSEC_PER_SEC),
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),^{
[self.countBTN setEnabled:YES];
[self.countBTN setTitle:@"Count" forState:UIControlStateReserved];
});
// after delta seconds, the button is re-enabled, but its title is still "Busy ..."
これが機能しない理由についての洞察をいただければ幸いです。