Showing posts with label copy or paste using iPhone sdk.. Show all posts
Showing posts with label copy or paste using iPhone sdk.. Show all posts

Friday, September 24, 2010

Methods for CUT, COPY n PASTE in any iPhone App.

-(IBAction)cut {
  [self copy];
  textPad.text = @"";
} 
 
-(IBAction)copy {

        NSString *copyString = [[NSString alloc] initWithFormat:@"%@",[textPad text]];
        UIPasteboard *pb = [UIPasteboard generalPasteboard];
        [pb setString:copyString];
}

-(IBAction)paste {
        UIPasteboard *pb = [UIPasteboard generalPasteboard];
        textPad.text = [pb string];
}