通过UIPasteBoard将图像粘贴到短信中
|
我想做的是从我的应用程序中将一些图像粘贴到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];
}
在调试模式下,我发现该图像确实存在,并且确实进入了粘贴板(我检查了该图像,并通过粘贴板中的图像引入了imageview,这是必需的)。
保存到剪贴板后,我打电话
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@\"sms:\"]];
它确实会弹出,但是当我点击“文本框”时,没有粘贴按钮显示。
有人可以指出我的错误吗?
还是这样做有意义?我的意思是,是否可以通过默认iPhone Message App发送图像?
没有找到相关结果
已邀请:
3 个回复
骚瓤
岭取
尝试这个
您可以在此处查找其他PasteboardType UTI \。
硕歌沙