Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用可达性代码检查 ip 的网络状态,但目前我正在使用 NSNotification Center。但我不想那样检查。只有当我尝试从主机下载内容时,我才需要检查网络状态。
目前,互联网连接能够正确检查,但无法检查主机可达性。这该怎么做?
iOS 4 可达性指南
无论您要访问网络,都应添加可访问性。否则苹果可能会拒绝您的应用程序。如果您想特别测试您的主机,则使用回调连接失败并带有错误回调来显示一些带有错误的警报视图或制作您自己的消息。
像这样的东西怎么样: