What I’m trying to do is to paste some images from my app in SMS.
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
NSString *imagefile = [[NSBundle mainBundle]
pathForResource:@"imagename"]
ofType:@"png"];
BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:imagefile];
if (fileExists){
UIImage *ui = [[UIImage alloc] initWithContentsOfFile:imagefile];
pasteboard.image = ui;
[ui release];
}
In debug mode I find out that the image DOES exist, and it DOES go to pasteboard (I checked it my introducing an imageview with the image from pasteboard, and it’s the necessary one).
After saving to clipboard, I call
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms:"]];
it does pop-up, but when i tap to “textfield” there, no Paste button shows.
Can somebody point at my mistake?
Or does it make sense doing so? I mean, is it possible to send a image through Default iPhone Message App?
“Paste” action will be shown only if the paste board contains the supported item for the current object(here Text Field) you tapped. It seems that you are adding only an image to the paste board. Text Field doesn’t support images. So “Paste” action doesn’t show up.