Instance Method

connectPeer:withNearbyConnectionData:

Call this method to connect a peer to the session when using your own service discovery code instead of an MCNearbyServiceBrowser or MCBrowserViewController object.

Declaration

- (void)connectPeer:(MCPeerID *)peerID withNearbyConnectionData:(NSData *)data;

Parameters

peerID

The peer ID object obtained from the nearby peer.

data

The connection data object obtained from the nearby peer.

Discussion

Call this method to connect to peers when you are using your own service discovery code instead of an MCNearbyServiceBrowser or MCBrowserViewController object. For more information, see the Managing Peers Manually section in the overview of the MCSession class reference.

See Also

Managing Peers Manually

- cancelConnectPeer:

Cancels an attempt to connect to a peer.

connectedPeers

An array of all peers that are currently connected to this session.

- nearbyConnectionDataForPeer:withCompletionHandler:

Obtains connection data for the specified peer.