iPhone中如何copy,cut,paste

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

 

代码一目了然,很简单吧。

你可能感兴趣的:(String,iPhone)