Note that there are some explanatory texts on larger screens.

plurals
  1. POReasons for UIimagePickerControler make crash
    primarykey
    data
    text
    <pre><code>-(IBAction)takePhoto:(id)sender { if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) { imgPicker = [[UIImagePickerController alloc] init]; imgPicker.sourceType = UIImagePickerControllerSourceTypeCamera; imgPicker.delegate = self; [self presentModalViewController:imgPicker animated:YES]; } } -(IBAction)btnCancelCamera_Clicked:(id)sender{ [self dismissModalViewControllerAnimated:YES]; } -(IBAction)btnCaptureImage_Clicked:(id)sender{ [imgPicker takePicture]; } -(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { [self savePhotoProcess:info]; } -(void)savePhotoProcess:(NSDictionary *)imgObject { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSInteger appcnt = [defaults integerForKey:@"LaunchAmounts"]; pickedImage = [imgObject objectForKey:UIImagePickerControllerOriginalImage]; [self dismissModalViewControllerAnimated:YES]; pickedImage = [self scaleAndRotateImage:pickedImage]; NSData *imageData = UIImageJPEGRepresentation(pickedImage,0.7); imageName = [NSString stringWithFormat:@"image%d.jpg",appcnt]; [imageArray addObject:imageName]; path = [SAVEDIMAGE_DIR stringByAppendingPathComponent:imageName]; [imageData writeToFile:path atomically:YES]; pickedImage=nil; imageData=nil; imgPicker=nil; } - (UIImage *)scaleAndRotateImage:(UIImage *)image { int width = image.size.width; int height = image.size.height; CGSize size = CGSizeMake(width, height); CGRect imageRect; if(image.imageOrientation==UIImageOrientationUp || image.imageOrientation==UIImageOrientationDown) { imageRect = CGRectMake(0, 0, width, height); } else { imageRect = CGRectMake(0, 0, height, width); } UIGraphicsBeginImageContext(size); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSaveGState(context); CGContextTranslateCTM(context, 0, height); CGContextScaleCTM(context, 1.0, -1.0); if(image.imageOrientation==UIImageOrientationLeft) { CGContextRotateCTM(context, M_PI / 2); CGContextTranslateCTM(context, 0, -width); } else if(image.imageOrientation==UIImageOrientationRight) { CGContextRotateCTM(context, - M_PI / 2); CGContextTranslateCTM(context, -height, 0); } else if(image.imageOrientation==UIImageOrientationUp) { //DO NOTHING } else if(image.imageOrientation==UIImageOrientationDown) { CGContextTranslateCTM(context, width, height); CGContextRotateCTM(context, M_PI); } CGContextDrawImage(context, imageRect, image.CGImage); CGContextRestoreGState(context); UIImage *img1 = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return (img1); } </code></pre> <p>I have imagePickerController in my app.It is keep crashing when tested by client.I could not simultate that crash.please somebody tell what are the reasons that cause crash so i can simulate that problem.any help will be appreicated.thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    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.
    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