【问题标题】:UIWebView Copy PasteUIWebView 复制粘贴
【发布时间】:2013-02-05 05:17:01
【问题描述】:

我正在处理UIWebView 操作 Copypaste ..我不知道它到底是如何工作的.. 我需要做的是...当我点击链接时,它应该复制URLUiTextFieldBrowser bar 它应该能够粘贴...

我正在做的是:

- (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
  }

请告诉我复制方法哪里出了问题,以及如何粘贴

【问题讨论】:

    标签: iphone ios uiwebview copy-paste


    【解决方案1】:

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

    [[UIPasteboard generalPasteboard] containsPasteboardTypes:UIPasteboardTypeListString];
    UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; 
    if (pasteboard.string != nil) { [self insertText:pasteboard.string]; }
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-05-13
    • 2012-07-02
    • 1970-01-01
    • 2012-12-03
    • 1970-01-01
    • 1970-01-01
    • 2011-10-04
    • 1970-01-01
    相关资源
    最近更新 更多