在iOS应用程序中实现可访问性(无互联网弹出窗口)的最简单方法是什么?

在iOS应用程序中实现可访问性(无互联网弹出窗口)的最简单方法是什么?,ios,xcode,Ios,Xcode,可能重复: 在iOS应用程序中实现可访问性(通知用户没有Internet连接的代码)的最简单方法是什么?我在appDelegate中实现了这一点 在appDelegate.h中: @interface myAppDelegate : NSObject <UIApplicationDelegate> { IBOutlet noInternetViewController *NoInternetViewController; BOOL isShowingNoInternetScreen

可能重复:


在iOS应用程序中实现可访问性(通知用户没有Internet连接的代码)的最简单方法是什么?

我在appDelegate中实现了这一点

在appDelegate.h中:

@interface myAppDelegate : NSObject <UIApplicationDelegate> {
IBOutlet noInternetViewController *NoInternetViewController;
BOOL isShowingNoInternetScreen;
}
我使用的是导航控制器,但如果没有,则只需将pushViewController:animated:更改为presentModalViewController:animated:并将PopViewController或animated:更改为dismissModalViewController


显然,您需要在Interface Builder中设置一个视图控制器,该控制器也绑定到IBMOutlet。当用户没有连接时,只需将其设置为您希望用户看到的任何内容。

我在appDelegate中执行了此操作

在appDelegate.h中:

@interface myAppDelegate : NSObject <UIApplicationDelegate> {
IBOutlet noInternetViewController *NoInternetViewController;
BOOL isShowingNoInternetScreen;
}
我使用的是导航控制器,但如果没有,则只需将pushViewController:animated:更改为presentModalViewController:animated:并将PopViewController或animated:更改为dismissModalViewController

显然,您需要在Interface Builder中设置一个视图控制器,该控制器也绑定到IBMOutlet。当用户没有连接时,只需将其设置为您希望用户看到的内容。

请参阅:请参阅: