iOS present AlertController时崩溃。 'Application tried to present modally an active controller <HKConne...

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present modally an active controller <HKConnectViewController: 0x1050158e0>.'

 

分析:

很有可能是你的触发事件中,触发了多次。也就是说:不止一次调用了present。

解决办法:

保证只执行一次

    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        [self presentViewController:self.bluetoothCloseAlertC animated:YES completion:nil];
    });

  

转载于:https://www.cnblogs.com/liuhuakun/p/11375511.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
引用内存不足RuntimeError: CUDA out of memory. Tried to allocate 16.00 MiB (GPU 0; 2.00 GiB total cap..._cuda out of memory. tried to allocate 4.88 gib (gp_周小董的博客-CSDN博客 。 引用和引用中,都有类似的错误信息,显示了程序尝试分配的内存大小和GPU的总内存容量。根据这些信息,可以得出结论是分配的内存超过了GPU的容量,导致内存溢出。 为了解决这个问题,可以尝试以下几种方法: 1. 减少模型的参数数量或减少输入数据的尺寸,以降低内存需求。 2. 增加GPU的内存容量,可以考虑使用更高容量的GPU或者在多个GPU上进行计算。 3. 使用PyTorch的内存优化技术,例如使用torch.no_grad()来减少内存占用或使用torch.cuda.empty_cache()来释放缓存的内存。 总结来说,当出现CUDA out of memory错误,需要注意内存的使用情况,适当调整模型和数据的大小,或者通过升级硬件来增加内存容量,以解决内存溢出的问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [CUDA out of memory. Tried to allocate 16.00 MiB (GPU 0; 6.00 GiB total capacity;总结(1)](https://blog.csdn.net/qq_38148600/article/details/120060303)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [解决:RuntimeError: CUDA out of ... Tried to allocate 160.00 MiB (GPU 0; 10.76 GiB total capacity..](https://blog.csdn.net/zcyzcyjava/article/details/127509058)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值