警告當我進入到相機的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];
}
注:內存警告出現在iPhone和iPad。
什麼是內存警告?你可以在這裏發佈嗎? – Bazinga
我收到「[1777:907]收到內存警告。」而已。每次都改變數字... –
嘗試'command + shift + B'告訴我它是否顯示一些東西。 – Bazinga