Monday, 26 August 2013

UiImagePickerController doesn't crop when using setShowsCameraControls:NO

UiImagePickerController doesn't crop when using setShowsCameraControls:NO

precode- (IBAction)showImagePickerCamera:(id)sender {
self.picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self.picker setDelegate:self]; self.picker.allowsEditing = YES;
self.customView = [[CustomCameraViewController
alloc]initWithNibName:@CustomCameraViewController bundle:nil];
[self.customView setCustomCameraDelegate:self]; [self
presentViewController:self.picker animated:NO completion:nil];
self.needsToShowImageSource = NO; [self
performSelector:@selector(customCameraTakeAPicture) withObject:nil
afterDelay:3]; [self.picker setShowsCameraControls:NO]; } /code/pre pHi
all! :D I have this piece of code. I'm using setAllowsEditing:YES and
setShowsCameraControls:NO. But if I set ShowsCameraControls = NO, the
uiimagepickercamera doesn't allow me to crop the image. I'm using a custom
view (CustomCameraViewController) to create the buttons to take a picture,
select the camera, the flash, etc. That's why i'm setting
ShowsCameraControls to NO. When I press to take a picture i'm calling/p
precode -(void)customCameraTakeAPicture { [self.picker
setShowsCameraControls:YES]; [self.picker takePicture]; } /code/pre pThat
takes me to the crop view but it doesn't show the square. And when i press
USE the app crashes with this error :/p precodeAug 26 04:42:50
Chad-DePues-iPod Modabound[13518] lt;Errorgt;: UIImage
*PLCreateCroppedImageFromImageWithQuality(UIImage *, CGRect, CGSize,
CGInterpolationQuality): failed to create context 2013-08-26 04:42:50.754
Modabound[13518:861b] *** Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '*** setObjectForKey: object cannot
be nil (key: croppedImage)' *** First throw call stack: (0x31c1f2a3
0x3989d97f 0x31b81313 0x36d538b7 0x36d79307 0x32535e85 0x39cf4311
0x39cf41d8) libc++abi.dylib: terminate called throwing an exception
/code/pre pAny suggestions ? I've been stack for hours with this and I run
out of ideas. /p pThanks!/p

No comments:

Post a Comment