-[meetingbot4ios.AppDelegate window]: unrecognized selector sent to instance

embedded/2024/9/23 2:56:36/

这个错误的困扰了我半天,具体错误如下:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[meetingbot4ios.AppDelegate window]: unrecognized selector sent to instance 0x60000370c0c0'

*** First throw call stack:

(

0   CoreFoundation                      0x00000001804ae0f8 __exceptionPreprocess + 172

1   libobjc.A.dylib                     0x0000000180087db4 objc_exception_throw + 56

2   CoreFoundation                      0x00000001804c2f48 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0

3   CoreFoundation                      0x00000001804b2024 ___forwarding___ + 732

4   CoreFoundation                      0x00000001804b456c _CF_forwarding_prep_0 + 92

5   MobileRTC                           0x00000001125bed2c MobileRTC + 16624940

6   CoreFoundation                      0x00000001803de7a8 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 140

7   CoreFoundation                      0x00000001803de6cc ___CFXRegistrationPost_block_invoke + 84

8   CoreFoundation                      0x00000001803ddbbc _CFXRegistrationPost + 404

9   CoreFoundation                      0x00000001803dd598 _CFXNotificationPost + 688

10  MobileRTC                           0x0000000112792840 MobileRTC + 18540608

11  MobileRTC                           0x0000000113b82624 MobileRTC + 39446052

12  MobileRTC                           0x0000000113b7f7a8 MobileRTC + 39434152

13  MobileRTC                           0x0000000113d0f0b0 MobileRTC + 41070768

14  MobileRTC                           0x0000000113cfc4b0 MobileRTC + 40993968

15  MobileRTC                           0x0000000113cfe520 MobileRTC + 41002272

16  MobileRTC                           0x0000000111675520 MobileRTC + 595232

17  MobileRTC                           0x0000000113cfde1c MobileRTC + 41000476

18  MobileRTC                           0x0000000113b83188 MobileRTC + 39448968

19  MobileRTC                           0x0000000113516a04 MobileRTC + 32713220

20  MobileRTC                           0x00000001116540bc MobileRTC + 458940

21  meetingbot4ios                      0x0000000102d00fe8 $s14meetingbot4ios11AppDelegateC11joinMeeting33_AF24E5846D9D1EA8BDA822FD40DAC3E8LLyyF + 700

22  meetingbot4ios                      0x0000000102d00858 $s14meetingbot4ios11AppDelegateC21onMobileRTCAuthReturnyySo0eF5ErrorVF + 308

23  meetingbot4ios                      0x0000000102d00b28 $s14meetingbot4ios11AppDelegateC21onMobileRTCAuthReturnyySo0eF5ErrorVFTo + 44

24  libdispatch.dylib                   0x00000001030a7ec4 _dispatch_call_block_and_release + 24

25  libdispatch.dylib                   0x00000001030a973c _dispatch_client_callout + 16

26  libdispatch.dylib                   0x00000001030b93f8 _dispatch_main_queue_drain + 1228

27  libdispatch.dylib                   0x00000001030b8f1c _dispatch_main_queue_callback_4CF + 40

28  CoreFoundation                      0x000000018040e960 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12

29  CoreFoundation                      0x0000000180409078 __CFRunLoopRun + 1936

30  CoreFoundation                      0x00000001804084d4 CFRunLoopRunSpecific + 572

31  GraphicsServices                    0x000000018ef2aae4 GSEventRunModal + 160

32  UIKitCore                           0x00000001853d0a28 -[UIApplication _run] + 868

33  UIKitCore                           0x00000001853d46b0 UIApplicationMain + 124

34  SwiftUI                             0x00000001ccf100e4 OUTLINED_FUNCTION_65 + 492

35  SwiftUI                             0x00000001ccf0ff8c OUTLINED_FUNCTION_65 + 148

36  SwiftUI                             0x00000001ccbcd6d8 OUTLINED_FUNCTION_0 + 92

37  meetingbot4ios                      0x0000000102cf7618 $s14meetingbot4ios10MeetingBotV5$mainyyFZ + 40

38  meetingbot4ios                      0x0000000102d07e10 main + 12

39  dyld                                0x0000000103635544 start_sim + 20

40  ???                                 0x000000010314a154 0x0 + 4346650964

41  ???                                 0x8e7d000000000000 0x0 + 10267362725474598912

)

libc++abi: terminating due to uncaught exception of type NSException

下面是我的解决办法。

class AppDelegate: UIResponder, UIApplicationDelegate {
    var window: UIWindow?

    // 其他代码...
}

只需要在其中增加var window: UIWindow?这行代码就可以了。


http://www.ppmy.cn/embedded/103012.html

相关文章

设计模式-结构型模式-组合模式

1.组合模式的定义 将对象组合成树形结构以表示整个部分的层次结构,组合模式可以让用户统一对待单个对象和对象的组合;其更像是一种数据结构和算法的抽象,其中数据可以表示成树这种数据结构,业务需求可以通过在树上的递归遍历算法来…

【问题解决】Jenkins的Pipeline无法正常后台启动Jar包

文章目录 问题描述排查Jenkins日志启动流水线观察Jar包启动情况初步推测问题问题原因:Jenkins进程管理机制问题解决:改写启动Jar包命令参考文章 问题描述 执行Jenkins的Pipeline,执行结果显示为成功,但是Java程序没有成功启动 排…

7z解压crc错误 7-Zip-常见问题解答

7-Zip 是一个流行的文件压缩和解压缩工具,但在使用过程中,有时会遇到 CRC(循环冗余校验)错误。这通常意味着压缩文件已损坏或未完全下载。以下是一些可能的原因及解决方案。 常见原因 文件损坏:下载过程中出现错误&a…

Shell脚本入门:多命令处理

我的后端学习大纲 我的Linux学习大纲 1.什么是多命令处理 1.多命令处理就是在Shell脚本文件中编写多个Shell命令 2.入门案例: 2.1.需求介绍: 1.在已知目录/root/itheima目录,执行batch.sh脚本,实现在/root/itheima/目录下创建一…

第二证券:三折折叠屏手机呼之欲出,14股业绩暴涨超200%

智能制作龙头大手笔投建机器人超级工厂 8月29日晚间,埃夫特发布公告称,公司拟运用自有或自筹资金在安徽省芜湖市经过购买土地用于出资制作埃夫特机器人超级工厂暨全球总部项目,根据初步测算,项目出资金额约人民币18.93亿元&#…

【面试】jvm静态变量和局部变量对比

目录 1. 说明2. 声明位置与所属3. 生命周期4. 访问方式5. 初始化6. 存储空间7. 线程安全性 1. 说明 1.在Java虚拟机(JVM)中,静态变量(类变量)和局部变量是两种不同类型的变量,它们在多个方面存在显著的区别…

神经网络卷积层

一、卷积操作 对应位置相乘相加,最终组成一个新的矩阵,实现了降维。 二、代码 import torch import torchvision from torch import nn from torch.nn import Conv2d from torch.utils.data import DataLoaderdataset torchvision.datasets.CIFAR10(&…

ArcGIS栅格裁剪与合并,制作等高线

1、下载高程数据(DEM) https://mp.weixin.qq.com/s/ewlUUVV0PwdcspPGtSdCog 项目区域对应的卫片,也可以在谷歌地图里看大致经纬度范围 2、项目区域 确定项目区域,例如某个县区范围 3、栅格裁剪与合并 将DEM多个栅格数据合并&#…