iPhone 中的自定义复制响应程序

发布于 2024-09-02 13:03:11 字数 214 浏览 8 评论 0原文

我的应用程序中有一个网络视图。我想处理当用户从网络视图复制某些内容时,我的自定义方法 - 应该被触发。我尝试过以下。

我已将以下方法放入 myViewCtr.m 文件中,

-(void)copy:(id)sender{
     NSLog(@"hi ! Hello ");
}

但没有任何效果 - 我应该做什么来实现相同的方法?

I have a webview in my application. I want to handle when user copies something from web view, my custom method - should be triggered. I have tried following.

I have placed following method in myViewCtr.m file

-(void)copy:(id)sender{
     NSLog(@"hi ! Hello ");
}

But nothing working - what should I do to implement the same ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

維他命╮ 2024-09-09 13:03:11

您需要在响应器上实现-copy:,而不是在控制器上实现。因此,您需要子类化 UIWebView 并覆盖 -copy:

You need to implement -copy: on the responder, not on the controller. So you need to subclass UIWebView and override -copy:.

蓦然回首 2024-09-09 13:03:11

啊!我从这个这里得到了一些东西问题

直接示例来自苹果公司本身。

理论 :)

Ahh ! I got something here from this question.

Direct sample from Apple itself.

Theory :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文