无法理解 iOS 系统 UIPasteboard

Not able to understand iOS System UIPasteboard

我正在使用自定义表情符号键盘,它是一个键盘扩展,问题是在单击按钮时我需要在粘贴板中复制图像并将其粘贴到另一个应用程序中。我使用了这些代码但无法将图像复制到粘贴板

-.h 文件中的代码

    UIPasteboard *pasteboard_img;

-viewDidLoad()中的代码

    pasteboard_img = [UIPasteboard generalPasteboard];

-在键盘上按下按钮时调用的方法中的代码

    [pasteboard_img setImage:[UIImage imageNamed:[array_image objectAtIndex:sender.tag]]];

~ 其中 array_image 是带有图像名称的数组。

 pasteboard_img.persistent=YES;

使用这个。