Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/vim/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 当用户单击UIAlertView的OK按钮时,移动到另一个视图_Ios_Uialertview - Fatal编程技术网

Ios 当用户单击UIAlertView的OK按钮时,移动到另一个视图

Ios 当用户单击UIAlertView的OK按钮时,移动到另一个视图,ios,uialertview,Ios,Uialertview,当我向用户显示警报时,如果他单击“确定”按钮,我需要将他移动到另一个屏幕,我该如何做: UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"TopStation" message :@"Your internet connection is down, you will be redirected to the previous screen"

当我向用户显示警报时,如果他单击“确定”按钮,我需要将他移动到另一个屏幕,我该如何做:

UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"TopStation"
                                                message :@"Your internet connection is down, you will be redirected to the previous screen"
                                                delegate:nil
                                       cancelButtonTitle:@"OK"
                                       otherButtonTitles:nil];
    [alert show];
    [alert release];

您需要做的是在所使用的方法中实现UIAlertView委托

如果你有课的话

@interface MyClass: UIViewController {
您需要将其更改为使用

@interface MyClass:UIViewController <UIAlertViewDelegate> {

从这里您可以继续。

您需要做的是在您正在使用的方法中实现UIAlertView委托

如果你有课的话

@interface MyClass: UIViewController {
您需要将其更改为使用

@interface MyClass:UIViewController <UIAlertViewDelegate> {

从这里您可以继续。

如何知道“确定”按钮的索引?apple文档仅提供原型默认情况下,“取消”按钮的索引为0如何知道“确定”按钮的索引?apple文档仅提供原型默认情况下,“取消”按钮的索引为0