iPhone Copy/Paste
I want two buttons in the app in a c开发者_JAVA百科ertain view, Copy and Paste. This view also has a textview. If someone presses the copy button, I want all of the text in that textview to be copied. If someone presses the past button, I want to append the text in the textview with that which is in the clipboard? How do I?
-(IBAction)copy {
pasteboard = [textField text];
}
-(IBAction)paste {
[textField setText:[[textField text] stringByAppendingString:pasteboard] ];
}
where pasteboard
is a NSString
Use UIPasteBoard
精彩评论