xcode的ios项目,拖拽一个webview到storyboard,运行app时闪退,报错
Could not instantiate class named WKWebView because no class named WKWebView was found;
the class needs to be defined in source code or linked in from a library
已经提示了no xxx was found,明显是缺少库
添加wkwebview库
添加后
为什么其他控件拖上去是正常的,但是webview拖上去就闪退呢。百度之后发现别人也有这种问题。原来是 xcode不会自动添加webview的引用,可能是webview的库比较大吧,如果自动添加,无形中增加app的体积。