在不同动作的控制器中,我需要UIAlertView
用“OK”和“CANCEL”按钮显示,每次“OK”点击这 5UIAlertView
秒需要做不同的事情。是否可以声明类似 lambda 函数的东西来指定每个“确定”按钮UIAlertView
要做什么?(在 5 个地方的代码中,我有不同的问题、消息和操作 ok,有些根本没有输入文本)
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Apply"
message:@"Are you sure you want to apply ?"
delegate:self
cancelButtonTitle:@"CANCEL"
otherButtonTitles:@"OK",
nil];
alert.alertViewStyle = UIAlertViewStylePlainTextInput;
[alert show];
(目前我记得导致UIAlertView
显示的动作,然后根据动作我做不同的事情,但它不是清晰的代码)。