我的应用程序在 iOS 15 和 14 上运行良好,也许在 13 上也运行良好。但是,当我在使用 iOS 12 的旧设备上运行时,即使在触发 didFinishLaunchingWithOptions 之前,它也会在启动时崩溃。上次我使用 Xcode 12 构建时运行良好。
Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named UINavigationBarAppearance because no class named UINavigationBarAppearance was found; the class needs to be defined in source code or linked in from a library (ensure the class is part of the correct target)' terminating with uncaught exception of type NSException
在 Xcode 13 中,故事板编辑器(以及故事板本身)包含有关导航栏外观 (UINavigationBarAppearance) 的信息:
但iOS 12中没有这样的类,所以这个storyboard不兼容在iOS 12下运行。
您可以通过使故事板向后兼容 iOS 12 来摆脱这个问题:
但我没有亲自尝试过,所以不能保证。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)