Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有人可以告诉我如何制作一个 IBAction,在 Safari 的 WebView 中打开当前链接。这样我在Safari中打开那个WebView的所有页面都可以用那个按钮打开。
谢谢。
- (IBAction)openLink { NSURL * currentURL = [myWebView.request URL]; [[UIApplication sharedApplication] openURL:currentURL]; }
这应该主要适用于通过那里加载loadRequest:或从那里遍历的 URL,但不适用于其他本地加载方法,如loadHTMLString:baseURL:
loadRequest:
loadHTMLString:baseURL: