我本以为处理UIPasteboard很简单,但事实证明这是一个耗时的问题……
我想在UIPasteboard中存储一个UIImage,然后将此图像粘贴到iMessage、WhatsApp、Gmail中……还有其他的。
这就是我使用UIPasteboard的方法
- (void) postClipboard
{
if ([[modelView currentView] isImage])
{
UIImage *image = [self readyImageLandscape:orientationLandscape];
[[UIPasteboard generalPasteboard] setImage:image];
}
}它可以在iPhone 3GS 5.1上工作。我已经在Gmail和WhatsApp上测试过了
然后,我将该方法修改为
- (void) postClipboard
{
if ([[modelView currentView] isImage])
{
UIImage *image = [self readyImageLandscape:orientationLandscape];
[[UIPasteboard generalPasteboard] setImage:image];
[[UIPasteboard generalPasteboard] setPersistent:YES];
}
}仍然可以在iPhone 3GS 5.1上工作。
但我的雇主说,无论是在WhatsApp还是在任何其他应用程序中,它都不能在iPhone 4S 6.0上工作。
是我做错了什么,还是应该有另一种方法让它在iPhone 4S 6.0上工作
发布于 2012-11-08 16:07:45
请看这个答案:https://stackoverflow.com/a/12613632/830946
看起来代码可以处理单个图像,但不能处理多个图像。
https://stackoverflow.com/questions/13284202
复制相似问题