<i id='vQ3e8'><tr id='vQ3e8'><dt id='vQ3e8'><q id='vQ3e8'><span id='vQ3e8'><b id='vQ3e8'><form id='vQ3e8'><ins id='vQ3e8'></ins><ul id='vQ3e8'></ul><sub id='vQ3e8'></sub></form><legend id='vQ3e8'></legend><bdo id='vQ3e8'><pre id='vQ3e8'><center id='vQ3e8'></center></pre></bdo></b><th id='vQ3e8'></th></span></q></dt></tr></i><div id='vQ3e8'><tfoot id='vQ3e8'></tfoot><dl id='vQ3e8'><fieldset id='vQ3e8'></fieldset></dl></div>
    <tfoot id='vQ3e8'></tfoot>
      <bdo id='vQ3e8'></bdo><ul id='vQ3e8'></ul>

    1. <small id='vQ3e8'></small><noframes id='vQ3e8'>

      1. <legend id='vQ3e8'><style id='vQ3e8'><dir id='vQ3e8'><q id='vQ3e8'></q></dir></style></legend>
      2. 如何检查设备是否有网络连接:cocos-2d

        时间:2024-08-12
              • <bdo id='w8Ikj'></bdo><ul id='w8Ikj'></ul>
                  <tbody id='w8Ikj'></tbody>
                <i id='w8Ikj'><tr id='w8Ikj'><dt id='w8Ikj'><q id='w8Ikj'><span id='w8Ikj'><b id='w8Ikj'><form id='w8Ikj'><ins id='w8Ikj'></ins><ul id='w8Ikj'></ul><sub id='w8Ikj'></sub></form><legend id='w8Ikj'></legend><bdo id='w8Ikj'><pre id='w8Ikj'><center id='w8Ikj'></center></pre></bdo></b><th id='w8Ikj'></th></span></q></dt></tr></i><div id='w8Ikj'><tfoot id='w8Ikj'></tfoot><dl id='w8Ikj'><fieldset id='w8Ikj'></fieldset></dl></div>

                <small id='w8Ikj'></small><noframes id='w8Ikj'>

                  <tfoot id='w8Ikj'></tfoot>
                • <legend id='w8Ikj'><style id='w8Ikj'><dir id='w8Ikj'><q id='w8Ikj'></q></dir></style></legend>
                  本文介绍了如何检查设备是否有网络连接:cocos-2d的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在我的一个 iPhone 应用程序中,我需要确定设备是否有互联网连接.有人帮忙吗?

                  In one of my iPhone app, I need to find out whether there is internet connection with the device or not. Anyone pls help?

                  推荐答案

                  使用 Reachability 类.

                  Use Reachability class.

                    if([self checkInternetConnected] ) 
                    {
                      NSLog(@"Internet connected
                  ");
                    } 
                  
                  
                  - (BOOL)checkInternetConnected 
                  {
                      Reachability *reachability = [Reachability reachabilityForInternetConnection];  
                      NetworkStatus networkStatus = [reachability currentReachabilityStatus]; 
                      return !(networkStatus == NotReachable);
                  }
                  

                  您可以在这里获得rechability类:下载示例 并将 Reachability.h 和 Reachability.m 添加到您的项目中.

                  You can get rechability class here : Download sample and add Reachability.h and Reachability.m into your project.

                  这篇关于如何检查设备是否有网络连接:cocos-2d的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:混合 C++ 和 Objective-C 下一篇:两条线之间的角度是错误的

                  相关文章

                • <small id='MGfje'></small><noframes id='MGfje'>

                • <legend id='MGfje'><style id='MGfje'><dir id='MGfje'><q id='MGfje'></q></dir></style></legend>
                  <i id='MGfje'><tr id='MGfje'><dt id='MGfje'><q id='MGfje'><span id='MGfje'><b id='MGfje'><form id='MGfje'><ins id='MGfje'></ins><ul id='MGfje'></ul><sub id='MGfje'></sub></form><legend id='MGfje'></legend><bdo id='MGfje'><pre id='MGfje'><center id='MGfje'></center></pre></bdo></b><th id='MGfje'></th></span></q></dt></tr></i><div id='MGfje'><tfoot id='MGfje'></tfoot><dl id='MGfje'><fieldset id='MGfje'></fieldset></dl></div>
                  • <bdo id='MGfje'></bdo><ul id='MGfje'></ul>

                    <tfoot id='MGfje'></tfoot>