我正在尝试将图像从URL保存到剪贴板。我尝试使用:
NSURL *url = [NSURL URLWithString:fromURL];
NSData *imageData = [[NSData alloc] initWithContentsOfURL:url];
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
[pasteboard setData:imageData forPasteboardType:@"kUTTypeJPEG"]; //is kUTTypeJPEG even the right type?
但它不起作用。它不会发出警告,错误或其他任何内容。
答案 0 :(得分:1)
试试这个,
将图像保存到剪贴板:
[UIPasteboard generalPasteboard] .image = someImage;
要从剪贴板再次获取图像:
UIImage * someImage = [UIPasteboard generalPasteboard] .image;