ios - 互联网不可用时关闭应用程序

标签 ios objective-c

我想在互联网连接不可用时关闭我的应用。

我检查过了,但我如何创建提醒,然后关闭我的应用程序?

最佳答案

您不应该强行关闭应用程序,因为终止应用程序的标准方法是按下主页按钮(或使用多任务栏)

Don’t Quit Programmatically


Never quit an iOS application programmatically because people tend to interpret this as a crash. However, if external circumstances prevent your application from functioning as intended, you need to tell your users about the situation and explain what they can do about it. Depending on how severe the application malfunction is, you have two choices.

Display an attractive screen that describes the problem and suggests a correction. A screen provides feedback that reassures users that there’s nothing wrong with your application. It puts users in control, letting them decide whether they want to take corrective action and continue using your application or press the Home button and open a different application

If only some of your application's features are not working, display either a screen or an alert when people activate the feature. Display the alert only when people try to access the feature that isn’t functioning.

Source

关于ios - 互联网不可用时关闭应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8003519/

相关文章:

ios - UITableViewController 表删除后不会刷新,但会在 viewWillAppear 上刷新

ios - 直接设置 NSSet 关系时,Core Data 会填充反向关系吗?

ios - 什么时候调用 viewDidLoad/viewDidAppear?

ios - 使用 Mac 进行 iBeacon 区域监控?

objective-c - iOS 同步 - 让核心数据对象知道它必须被推送到服务器的好方法是什么?

ios - 在运行时获取主 Storyboard

ios - 如何从 Swift 中的另一个 View 调用 contentOffset?

objective-c - 从电话号码中获取区号

objective-c - 使用 NSString 显示数组内容

objective-c - 获取多行标签中子字符串中的词框