开发者

iPhone Copy/Paste

开发者 https://www.devze.com 2023-03-10 12:44 出处:网络
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.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消