UIImagePickerViewControllerを使用して、アプリのiPhoneのデフォルトカメラから写真を撮り、ドキュメントディレクトリに保存しています。プロセスの完了に時間がかかり、テーブルビューでの表示が非常に遅くなります。画像のサイズ変更はここで役立ちますか?
-(IBAction)takePhoto:(id)sender
{
if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera])
{
imgPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:imgPicker animated:YES];
}
}
-(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *pickedImage = [info objectForKey:UIImagePickerControllerOriginalImage];
[self dismissModalViewControllerAnimated:YES];
NSData *imageData = UIImagePNGRepresentation(pickedImage);
NSString *path = [SAVEDIMAGE_DIR stringByAppendingPathComponent:@"image.png"];
[imageData writeToFile:path atomically:YES];
}