Note that there are some explanatory texts on larger screens.

plurals
  1. POBlack screen appears, randomly after taking an image and tapping 'USE' in the UIImagePickerController
    primarykey
    data
    text
    <p>I have an app that's almost done and now while it was under QA, the QA engineer came across a random issue in which a black screen appears after tapping on USE in <code>UIImagePickerController</code> view. Further in <code>didFinishPickingMediaWithInfo</code> the image is being saved for future refrencing and is being shown in an <code>UIImageView</code>, I am also using camera overlay for adding a button to the <code>UIImagePickerView</code> and the max memory usage of the app doen't goes beyond <strong>13 MB</strong>. The issue is not arising when switching to Camera roll mode from capture mode. Also in the same view <code>iADs</code> are being presented. Underneath is the code, to which the issue may concern, also images are being attached to get an idea of the issue. Any help would be greatly appreciated.</p> <p>Thanks in advance.</p> <p><img src="https://i.stack.imgur.com/VTjCf.jpg" alt="Image Picker Controller"></p> <p><img src="https://i.stack.imgur.com/W3GRW.png" alt="THIS IMAGE IS CORRECT, THIS IS HOW THE VIEW SHOULD BE PRESENTED"></p> <p><img src="https://i.stack.imgur.com/0po09.png" alt="RANDOMLY THIS SCREEN APPEARS AFTER TAPPING ON USE, THOUGH ON NAVIAGTING TO AND FRO TO OTHER TABS THE CORRECT SCREEN[THE SCREEN NUMBER 2] DOES APPEARS."></p> <pre><code>(void) launchCamera { // Set up the camera\ CustomCameraView *cameraController = [[CustomCameraView alloc] init]; cameraController.sourceType = UIImagePickerControllerSourceTypeCamera; cameraController.delegate = self; cameraController.showsCameraControls = YES; cameraController.navigationBarHidden = YES; cameraController.toolbarHidden = YES; // overlay on top of camera lens view UIButton *cameraRoll = [[UIButton alloc] initWithFrame:CGRectMake(15, 380, 40, 40)]; [cameraRoll setAlpha:0.0f]; [cameraRoll setBackgroundImage:[UIImage imageNamed:@"CamerRoll_New"] forState:UIControlStateNormal]; [cameraRoll addTarget:self action:@selector(switchToCameraRoll) forControlEvents:UIControlEventTouchUpInside]; cameraController.cameraOverlayView = cameraRoll; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDelay:1.5f]; cameraRoll.alpha = 1.0f; [UIView commitAnimations]; [self presentModalViewController:cameraController animated:YES]; } -(void)switchToCameraRoll { DLog(@"Camera Roll"); [self dismissViewControllerAnimated:NO completion:^(void){ [self photoSourcePhotoAlbum];}]; } -(void) photoSourcePhotoAlbum { UIImagePickerController * picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; [self presentModalViewController:picker animated:YES]; } - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { [self.view addSubview:progressView]; timer = [NSTimer scheduledTimerWithTimeInterval:.017 target:self selector:@selector(progressChange) userInfo:nil repeats:YES]; [picker dismissModalViewControllerAnimated:YES]; [self performSelectorInBackground:@selector(saveImage:) withObject:info]; [self performSelector:@selector(navigateToEditView) withObject:nil afterDelay:2.1]; } -(void)navigateToEditView { [self performSegueWithIdentifier:@"presentRDetailModalViewController" sender:self]; } - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { if (picker.sourceType == UIImagePickerControllerSourceTypeSavedPhotosAlbum) { [picker dismissViewControllerAnimated:NO completion:^(void){ [self photoSourceCamera];}]; } else { [picker dismissModalViewControllerAnimated:YES]; } } -(void)saveImage:(NSDictionary *)info { NSString *imageName = [[[DataStaging dataStaging] getGUID] stringByAppendingString:@".jpg"]; rImageName = imageName; UIImage *rImage = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; //Compress image [[FileOperations fileOperations] PersistData:UIImageJPEGRepresentation(rImage, 0.4) name:imageName]; DLog(@"%@",[[FileOperations fileOperations] fetchPath:imageName]); //Actual image taken [[self rImageView] setImage:[info objectForKey:@"UIImagePickerControllerOriginalImage"]]; if ([rImageName length] == 0) { [[self rDetails] setHidden:YES]; [[self trashRImage] setHidden:YES]; } else { [[self rDetails] setHidden:NO]; [[self trashRImage] setHidden:NO]; } [progressView removeFromSuperview]; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload