UITextView cut problem ! (iPhone sdk)
i have problem with cut some text from UITextView , i idon't understand how can implement Cut , for example copy or paste it's like this :
-(IBAction)copy {
NSString *copyString = [[NSString alloc] initWithFormat:@"%@",[textPad text]];
UIPasteboard *pb = [UIPasteboard genera开发者_如何转开发lPasteboard];
[pb setString:copyString];
}
-(IBAction)paste {
UIPasteboard *pb = [UIPasteboard generalPasteboard];
textPad.text = [pb string];
}
but about cut ! thank you ,
You can do this, since a cut is just a copy and a delete:
-(IBAction)cut {
[self copy];
textPad.text = @"";
}
精彩评论