我正在处理UIWebView
动作Copy
和paste
..我不知道它是如何工作的。
我需要做的是...当我点击链接时,它应该复制URL
并在UiTextField
或Browser 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
}
请让我知道复制方法在哪里出错了,以及如何粘贴
最佳答案
[[UIPasteboard generalPasteboard] containsPasteboardTypes:UIPasteboardTypeListString];
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
if (pasteboard.string != nil) { [self insertText:pasteboard.string]; }
关于iphone - UIWebView复制粘贴,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14700644/