wie*_*mon 0 iphone objective-c uialertview
我有一个UIAlertView设置文本字段如下:
//***first set of code***
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"User Input Required" message:@"Please enter data into the field" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok", nil];
[alert addTextFieldWithValue:nil label:@"[Enter Text]"];
[[alert textField] becomeFirstResponder];
[alert show];
[alert release];
//***second set of code***`
Run Code Online (Sandbox Code Playgroud)
如何才能使用户需要单击一个按钮(我已经设置了该方法以将输入发送到字符串)之前的任何"第二组代码"被触发了?
我需要将第二组代码包含在与警报相同的部分中(因此我不能在'dismissWithClickedButtonIndex'方法中运行它)并且第二组代码使用从用户输入获得的字符串,因此这就是为什么我不希望在用户点击按钮之前运行该代码.
| 归档时间: |
|
| 查看次数: |
2630 次 |
| 最近记录: |