AcceptConnectionFromPeer 生成 EXC_BAD_ACCESS
我尝试在 2 台设备(iPhone、iPad...)之间设置蓝牙连接。
一切工作正常,直到客户端发出连接请求并且主机在调用acceptConnectionFromPeer(EXC_BAD_ACCESS)时崩溃
-(void)session:(GKSession*)session didReceiveConnectionRequestFromPeer:(NSString*)peerID
{
NSError* error=nil;
[m_pSession acceptConnectionFromPeer:peerID error:&error];
}
m_pSession
有效。.尝试
NSString* displayName = [m_pSession displayNameForPeer:peerID];
在同一个地方使用工作正常
如果有人有什么想法,请让我知道。
I try to setup a bluetooth connection between 2 devices (iPhone, iPad..).
Everyting works fine until the client makes a connection request and the host crashes when calling acceptConnectionFromPeer (EXC_BAD_ACCESS)
-(void)session:(GKSession*)session didReceiveConnectionRequestFromPeer:(NSString*)peerID
{
NSError* error=nil;
[m_pSession acceptConnectionFromPeer:peerID error:&error];
}
m_pSession
is valid.. trying to use
NSString* displayName = [m_pSession displayNameForPeer:peerID];
in the same place works fine
If anyone has an ideea what's wrong please let me know.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
收到连接请求通知的
session
看起来与m_pSession
引用的会话不同。尝试更改为:It looks like the
session
that is getting notified of the connection request isn't the same session that referenced bym_pSession
. Trying changing to: