How to clear/empty pasteboard on viewWillDisappear

后端 未结 3 1475
时光说笑
时光说笑 2020-12-18 03:38

I use UIPasteboard to copy/paste text between two UITextView.

Code looks like this:

- (void)viewDidLoad {
   [super viewDid         


        
3条回答
  •  囚心锁ツ
    2020-12-18 04:13

    iOS – UIPasteboard

    Try the following:

        UIPasteboard *pb = [UIPasteboard generalPasteboard];
        [pb setValue:@"" forPasteboardType:UIPasteboardNameGeneral];
    

    Arab_Geek's response is correct but available for Cocoa (and I suspect you are looking for an iOS solution)

提交回复
热议问题