我正在开发一个应用程序,我需要在其中捕获多个图像并将它们存储在一个文件夹中。当图像超过时,应用程序崩溃。另外,在拍摄图像时,iPhone 速度会变慢一点。请任何人都可以帮助我。
捕获图像的代码
UIImagePickerController *picker=[[UIImagePickerController alloc]init];
picker.delegate=self;
picker.sourceType=UIImagePickerControllerSourceTypeCamera;
[self.navigationController presentModalViewController:picker animated:YES];
将图像添加到文件中的代码
NSString *pngImagePath =
[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES) lastObject]
stringByAppendingPathComponent:[NSString
stringWithFormat:@"%@.png",imageName]];
[dataImage writeToFile:pngImagePath atomically:YES];