有什么方法可以将屏幕截图保存到应用程序的沙箱中,或者可以很容易地找到添加到电子邮件附件的地方?目前我将其保存在相机胶卷中,但似乎无法将其附加到我的电子邮件中
NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentDirectory = [path objectAtIndex:0];
NSString *png = @".png";
NSString *filename = [drawquestion stringByReplacingOccurrencesOfString:@" " withString:@""];
NSString *link = [NSString stringWithFormat: @"%@%@%@", documentDirectory,filename,png];
NSString *imagePath = [NSHomeDirectory() stringByAppendingPathComponent:link];
NSLog(link);
UIImageWriteToSavedPhotosAlbum(viewImage, drawquestion, nil, nil);