c***@163.com
c***@163.com
  • 发布:2019-11-21 17:24
  • 更新:2019-11-22 11:08
  • 阅读:2094

IOS本地打包出现NSObjectNotAvailableException异常

分类:wap2app

基于最新的xcode版本建立的项目,手动替换了相应的资源和配置,运行后页面显示出来,但是出现异常日志如下,目前配置的target为9.0版本,之前修改为8.0版本测试过,也是同样的问题

Terminating app due to uncaught exception 'NSObjectNotAvailableException', reason: 'UIAlertView is deprecated and unavailable for UIScene based applications, please use UIAlertController!'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23c4f02e exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff50b97b20 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23c4ee6c +[NSException raise:format:] + 188
3 UIKitCore 0x00007fff46db0643 -[UIAlertView initWithFrame:] + 361
4 UIKitCore 0x00007fff46db0cb8 -[UIAlertView initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles:] + 218
5 uclass 0x0000000106428333
39-[H5PUIUserTipImp showFeatureNotFound:]_block_invoke + 310
6 libdispatch.dylib 0x0000000106a5add4 _dispatch_call_block_and_release + 12
7 libdispatch.dylib 0x0000000106a5bd48 _dispatch_client_callout + 8
8 libdispatch.dylib 0x0000000106a69de6 _dispatch_main_queue_callback_4CF + 1500
9 CoreFoundation 0x00007fff23bb1df9 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9
10 CoreFoundation 0x00007fff23baca59 __CFRunLoopRun + 2329
11 CoreFoundation 0x00007fff23babe16 CFRunLoopRunSpecific + 438
12 GraphicsServices 0x00007fff38438bb0 GSEventRunModal + 65
13 UIKitCore 0x00007fff4784fb48 UIApplicationMain + 1621
14 testdemo 0x000000010633aadd main + 125
15 libdyld.dylib 0x00007fff51a1dc25 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

这是项目结构

2019-11-21 17:24 负责人:无 分享
已邀请:
c***@163.com

c***@163.com (作者)

已解决,在最新版的xcode上会自动生成SceneDelegate文件,配置环境时要将此文件及其相应的info.plist上的信息删除即可

该问题目前已经被锁定, 无法添加新回复