This is a bug, which I just reported to Apple. The docs claim the didReceiveCertificate
callback is optional, but it's not. Add this method to your MCSessionDelegate
:
- (void) session:(MCSession *)session didReceiveCertificate:(NSArray *)certificate fromPeer:(MCPeerID *)peerID certificateHandler:(void (^)(BOOL accept))certificateHandler
{
certificateHandler(YES);
}
The random disconnects should cease.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…