카메라에 UIImagePickerController를 입력하면 언젠가는 메모리 경고 메시지가 나타나고이를 해결하는 방법을 모르겠습니다.카메라 UIImagePickerController에서받은 메모리 경고
-(IBAction)addImageCamera:(id)sender
{
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
pickerImgCamera.sourceType = UIImagePickerControllerSourceTypeCamera;
cameraView.image=[img imageFromMainBundleFile:@"frameCam.png"];
pickerImgCamera.cameraOverlayView=cameraView;
[self.navigationController presentModalViewController:pickerImgCamera animated:NO];
}
else
{
UIAlertView*alert=[[UIAlertView alloc] initWithTitle:@"Oops" message:@"Camera not found" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alert show];
alert=nil;
}
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
if (picker.sourceType == UIImagePickerControllerSourceTypeCamera)
{
[self dismissModalViewControllerAnimated:YES];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
});
}
[photoImage setImage:image];
}
참고 :
이 내 코드 메모리 경고가 아이폰과 아이 패드에 나타납니다.
메모리 경고 란 무엇입니까? 여기에 게시 할 수 있습니까? – Bazinga
"[1777 : 907]받은 메모리 경고"가 표시됩니다. 그게 다야. 때마다 숫자가 바뀝니다 ... –
'command + shift + B'는 뭔가 표시되는지 알려줍니다. – Bazinga