我见过被问及如何将图像添加到模拟器许多问题,并看到两个答案:的iOS SDK 4.0和4.1图像添加到仿真
- 单击并按住移动Safari保存在手机上
- 将文件添加到100APPLE(或其他)文件夹
无论是在以前的一切到iOS SDK 4.0伟大的工作。这些相同的方法不再适用于我,也不适用于我所见过的任何人。我曾尝试使用下面的代码块,我发现某处手动写入到照片库的图像:
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo{
UIAlertView *alert;
if (error) // Unable to save the image
alert = [[UIAlertView alloc] initWithTitle:@"Error"
message:@"Unable to save image to Photo Album."
delegate:self cancelButtonTitle:@"Ok"
otherButtonTitles:nil];
else // All is well
alert = [[UIAlertView alloc] initWithTitle:@"Success"
message:@"Image saved to Photo Album."
delegate:self cancelButtonTitle:@"Ok"
otherButtonTitles:nil];
[alert show];
[alert release];
}
但每一次它的错误。那么,模拟器的写访问是否存在问题?或只是一些错误?我已经更新到iOS 4.1 SDK,希望它能被修复,但事实并非如此。
Safari方法适用于我。 – jtbandes 2010-07-29 06:49:04
究竟如何?您可以使用4.0 SDK中的图像进行点击并选择保存,然后显示在Photo Library的UIImagePickerController中? – alunsford3 2010-07-30 04:07:48
>>但每次都会出错。 – geowar 2010-10-06 23:05:13