首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >UIWebView复制粘贴

UIWebView复制粘贴
EN

Stack Overflow用户
提问于 2013-02-05 13:17:01
回答 1查看 1.3K关注 0票数 0

我正在处理UIWebView操作Copypaste ..I不知道它是如何工作的.我需要什么,我做is...When我点击链接,它应该复制的URL和在UiTextFieldBrowser bar它应该能够粘贴…

我所做的是:

代码语言:javascript
复制
- (void)actionSheet:(UIActionSheet *)actionSheet
clickedButtonAtIndex:(NSInteger)buttonIndex {

if([title isEqualToString:@"Copy"]){ 

   NSURL *requestedURL = [request URL];
   NSString *link = [requestedURL absoluteString];
    UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];

    pasteboard.string = link;

    NSLog(@"paste is %@",pasteboard.string); // this does not give me the anything
  }

请让我知道我在复制方法中哪里出错了,以及如何粘贴它

EN

回答 1

Stack Overflow用户

发布于 2013-02-05 13:21:35

通过此链接:- http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIPasteboard_Class/Reference.html

代码语言:javascript
复制
[[UIPasteboard generalPasteboard] containsPasteboardTypes:UIPasteboardTypeListString];
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; 
if (pasteboard.string != nil) { [self insertText:pasteboard.string]; }
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14700644

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档