level 1
来自无名星的我
楼主

代码如上,运行之后,窗口显示空白,控制台如下:2022-04-22 14:13:02.804570+0800 testwebview[72638:4796651] Metal API Validation Enabled
2022-04-22 14:13:02.821557+0800 testwebview[72638:4796651] [] [0x15004a820] CVCGDisplayLink::setCurrentDisplay: 0
2022-04-22 14:13:02.821698+0800 testwebview[72638:4796651] [] [0x15004a800] CVDisplayLinkCreateWithCGDisplays count: 1 [displayID[0]: 0x0] [CVCGDisplayLink: 0x15004a820]
2022-04-22 14:13:02.822878+0800 testwebview[72638:4796651] [] networkd_settings_read_from_file Sandbox is preventing this process from reading networkd settings file at "/Library/Preferences/com.apple.networkd.plist", please add an exception.
2022-04-22 14:13:02.822995+0800 testwebview[72638:4796651] [] networkd_settings_read_from_file Sandbox is preventing this process from reading networkd settings file at "/Library/Preferences/com.apple.networkd.plist", please add an exception.
2022-04-22 14:13:02.832144+0800 testwebview[72638:4796651] [] [0x13f826820] CVCGDisplayLink::setCurrentDisplay: 1
2022-04-22 14:13:02.832175+0800 testwebview[72638:4796651] [] [0x13f826800] CVDisplayLinkCreateWithCGDisplays count: 1 [displayID[0]: 0x1] [CVCGDisplayLink: 0x13f826820]
2022-04-22 14:13:02.881744+0800 testwebview[72638:4796651] [Process] 0x1120507c0 - [PID=0] WebProcessProxy::didFinishLaunching: Invalid connection identifier (web process failed to launch)
2022-04-22 14:13:02.881768+0800 testwebview[72638:4796651] [Process] 0x1120507c0 - [PID=0] WebProcessProxy::processDidTerminateOrFailedToLaunch: reason=4
2022-04-22 14:13:02.881820+0800 testwebview[72638:4796651] [Process] 0x14903be18 - [pageProxyID=6, webPageID=7, PID=0] WebPageProxy::processDidTerminate: (pid 0), reason 4
2022-04-22 14:13:02.882119+0800 testwebview[72638:4796651] [Loading] 0x14903be18 - [pageProxyID=6, webPageID=7, PID=0] WebPageProxy::dispatchProcessDidTerminate: reason=Crash
2022-04-22 14:13:02.893805+0800 testwebview[72638:4796651] [Process] 0x112050e00 - [PID=0] WebProcessProxy::didFinishLaunching: Invalid connection identifier (web process failed to launch)
2022-04-22 14:13:02.893823+0800 testwebview[72638:4796651] [Process] 0x112050e00 - [PID=0] WebProcessProxy::processDidTerminateOrFailedToLaunch: reason=4
2022-04-22 14:13:02.893871+0800 testwebview[72638:4796651] [Process] 0x14903be18 - [pageProxyID=6, webPageID=7, PID=0] WebPageProxy::processDidTerminate: (pid 0), reason 4
2022-04-22 14:13:02.893944+0800 testwebview[72638:4796651] [Loading] 0x14903be18 - [pageProxyID=6, webPageID=7, PID=0] WebPageProxy::dispatchProcessDidTerminate: reason=Crash
2022-04-22 14:13:02.902630+0800 testwebview[72638:4796651] [Process] 0x14903be18 - [pageProxyID=6, webPageID=7, PID=0] WebPageProxy::tryReloadAfterProcessTermination: process crashed and the client did not handle it, not reloading the page because we reached the maximum number of attempts