gpt4 book ai didi

iOS - GKPeerPickerController [picker dismiss] 崩溃

转载 作者:行者123 更新时间:2023-11-29 13:12:30 26 4
gpt4 key购买 nike

我正在使用 GKPeerPickerController,这是我的简单代码:

- (IBAction)turnOn:(id)sender {
GKPeerPickerController *peerpicker = [[GKPeerPickerController alloc]init];
peerpicker.delegate = self;
peerpicker.connectionTypesMask = GKPeerPickerConnectionTypeNearby;
[peerpicker show];
}

-(GKSession*)peerPickerController:(GKPeerPickerController *)picker sessionForConnectionType:(GKPeerPickerConnectionType)type
{
[picker dismiss];
NSLog(@"picker Dismissed");
return nil;
}

turnOn 是从按钮触发的 IBAction。问题是,在选择器被关闭后,应用程序崩溃并出现 EXC_BAD_ACCESS 错误,为什么?我该如何解决?这是来自控制台:

2013-06-01 14:28:57.659 iShare[829:907] BTM: attaching to BTServer
2013-06-01 14:29:00.873 iShare[829:907] BTM: local device power state changed
2013-06-01 14:29:00.876 iShare[829:907] BTM: power is now on
2013-06-01 14:29:00.883 iShare[829:907] picker Dismissed

我的 iPhone 3GS 越狱了,会不会有问题?谢谢!!

最佳答案

你正在从 sessionForConnection 中解雇你的选择器,这是一个不寻常的选择,但是调用 [self dismissModalViewControllerAnimated: YES];而不是 [picker dismiss] 应该更适合你。

关于iOS - GKPeerPickerController [picker dismiss] 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16872743/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com