0

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

Christien
  • 1,213
  • 4
  • 18
  • 32

1 Answers1

1

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]; }
Nimit Parekh
  • 16,776
  • 8
  • 50
  • 72
Paresh Karnawat
  • 312
  • 1
  • 3
  • 13
  • thanks..I made mistake in my code... if you could help me in this question then,,, http://stackoverflow.com/questions/14686406/uilongpressgesturerecognizer-not-working/14687134#14687134 – Christien Feb 05 '13 at 05:58