WKWebView 注册js和移除js

/*! @abstract Adds a script message handler to the main world used by page content itself.
@param scriptMessageHandler The script message handler to add.
@param name The name of the message handler.
@discussion Calling this method is equivalent to calling addScriptMessageHandler:contentWorld:name:
with [WKContentWorld pageWorld] as the contentWorld argument.
*/

  • (void)addScriptMessageHandler:(id <WKScriptMessageHandler>)scriptMessageHandler name:(NSString *)name;
    每调佣一次,webview被retain一次。
    说明这里是强引用,
    在退出的时候,必须remove掉。
    才能彻底释放掉webview.
全部评论

相关推荐

09-22 22:22
中山大学 Java
乌鱼子萨奇:羡慕你啊,直接转正了,都不用经历秋招的炼狱,但是你少经历了很多痛苦的事情啊
点赞 评论 收藏
分享
09-19 12:15
门头沟学院 Java
迷茫的大四🐶:这下是真的打牌了,我可以用感谢信和佬一起打牌吗
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务