Christien
Christien

Reputation: 1213

UIWebView Copy Paste

I am HandlingUIWebView actions Copy and paste ..I don't know Exactly how it works.. What I need i do is...When I tap on link it should copy the URL and in UiTextField or Browser bar it should be able to paste ...

what I am doing is :

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

please let me know where i am going wrong in the copy method,,,and how it be pasted

Upvotes: 0

Views: 1273

Answers (1)

Paresh Karnawat
Paresh Karnawat

Reputation: 312

Go through this link:- 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]; }

Upvotes: 1

Related Questions