UIMagePickerController를 사용하여 둘 이상의 사진을 찍을 때 내 앱이 작동을 멈 춥니 다. 따라서 처음으로 사진을 찍을 때 모든 문제가 없으며 두 번째로 앱 오류가 발생하지 않고 오류 메시지가 표시됩니다. 여기 사진을 찍을 때 앱이 깨집니다. UIImagePickerController
2013-01-11 16:36:24.178 DoodleStash[26778:907] Received memory warning.
내가 사진 걸릴 사용하고있는 코드입니다 : 내가 주변이 처음받을 수 있나요
- (IBAction)takePhoto:(id)sender {
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.mediaTypes = [NSArray arrayWithObjects:(NSString *) kUTTypeImage, nil];
[self presentViewController:imagePicker animated:YES completion:nil];
self.isNewDoodle = TRUE;
}}
그리고 여기 것은 내가 사진
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType];
[self dismissViewControllerAnimated:YES completion:nil];
if ([mediaType isEqualToString:(NSString *) kUTTypeImage]) {
self.doodleImage = [info objectForKey:UIImagePickerControllerOriginalImage];
// Check to make sure the image is new
if (self.isNewDoodle == TRUE) {
UIImageWriteToSavedPhotosAlbum(self.doodleImage, self, @selector(image:finishedSavingWithError:contextInfo:), nil);
}
[self performSegueWithIdentifier:@"confirmUploadSegue" sender:self];
}}
을 저장하는 데 사용하는거야 정말 이에 대한 도움을 주셔서 감사합니다. 카메라를 클릭 한 후 이미지를 저장하기위한
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.delegate = self;
[self presentViewController:imagePicker animated:YES completion:nil];
이의 시도 :
**UPDATED ANSWER**
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
if (self.isNewDoodle == TRUE)
{
UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:finishedSavingWithError:contextInfo:), nil);}
[self performSegueWithIdentifier:@"confirmUploadSegue" sender:self];
}
[self dismissViewControllerAnimated:YES completion:nil];
}
- (void)image:(NSString*)videoPath didFinishSavingWithError:(NSError*)error contextInfo:(void*)contextInfo
{
if (error)
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Photo Saving Failed" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles: nil, nil];
[alert show];
}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Photo Saved" message:@"Saved To Photo Album" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles: nil];
[alert show];
}
}
지금이 & 확인을 시도 전체 코드는 여기
https://gist.github.com/4515007
감사합니다. @Vishal. 이 문제로 어떻게 문제가 해결되는지 또는 다른 점이 무엇인지 설명해 주시겠습니까? –
위의 해결책을 시도했지만 도움이되지 않았습니다. –
내 대답 업데이트 @Andrei Taraschuk ... – Vishal