从连接到NotConnected的多路连接会话

时间:2016-02-03 01:30:42

标签: ios swift macos multipeer-connectivity

我开发了一个非常简单的概念项目来测试OS X和iOS平台上的Multipeer Connectivity框架。他们每次都可以找到对方,但无法连接。会话状态将从“连接”更改为“未连接”。

我尝试过不同的MacBook和iOS设备,也在iOS模拟器上,并且行为相同。

我的源代码已上传到https://gist.github.com/hcwang/1a62d7a2def4d271d950

感谢您的亲切帮助。

1 个答案:

答案 0 :(得分:0)

我相信你的功能

array(3) {
  [0]=>
  array(2) {
    ["acf_fc_layout"]=>
    string(11) "sec_bt_post"
    ["sec_post_posts"]=>
    array(3) {
      [0]=>
      int(175220)
      [1]=>
      int(175219)
      [2]=>
      int(175062)
    }
  }
  [1]=>
  array(2) {
    ["acf_fc_layout"]=>
    string(12) "sec_bt_texto"
    ["sec_c_textos"]=>
    array(1) {
      [0]=>
      array(5) {
        ["sec_bt_tnumeracion"]=>
        bool(true)
        ["sec_bt_ttitle"]=>
        string(65) "Si se activa, tendrá que agregar el numero de orden al título 1"
        ["sec_bt_tubicaimg"]=>
        string(1) "0"
        ["sec_bt_tdescripcion"]=>
        string(598) "
8. You hate staying at other people’s houses because you miss your own bed too much. 9. You consider 10pm a really late night. 10. You would never start watching a film after 9pm. 11. You are perfectly capable of NOT binge-watching box sets on Netflix. 12. The best thing about going on holiday is getting home and crawling into your own bed. 13. You get into your pyjamas as soon as you are home for the day.





"
        ["sec_bt_timages"]=>
        array(1) {
          [0]=>
          array(1) {
            ["sec_bt_timagen"]=>
            int(175232)
          }
        }
      }
    }
  }
  [2]=>
  array(2) {
    ["acf_fc_layout"]=>
    string(12) "sec_mgz_tips"
    ["sec_bt_tips"]=>
    array(2) {
      [0]=>
      array(2) {
        ["sec_bt_tip"]=>
        string(6) "LINK 1"
        ["sec_bt_tip_title"]=>
        string(5) "TIP 1"
      }
      [1]=>
      array(2) {
        ["sec_bt_tip"]=>
        string(6) "LINK 2"
        ["sec_bt_tip_title"]=>
        string(5) "TIP 2"
      }
    }
  }
}

您需要...

func session(session: MCSession, didReceiveCertificate certificate: [AnyObject]?, fromPeer peerID: MCPeerID, certificateHandler: (Bool) -> Void){

}

希望有帮助