3

Question: Why imagePickerController.cameraFlashMode always returns 0 on iphone 4 and returns correct values with iphone 5 ?

I init my UIImagePickerController and set the cameraFlashMode to UIImagePickerControllerCameraFlashModeOn:

imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePickerController.mediaTypes = [NSArray arrayWithObject:@"public.image"];
imagePickerController.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
imagePickerController.showsCameraControls = NO;
imagePickerController.cameraFlashMode = UIImagePickerControllerCameraFlashModeOn;
[rest of overlay creation...]

Then when the flash button of my custom overlay is pressed, this method is fired: enter image description here

As you can see in the screenshot below the value of cameraFlashMode is correct in the 'variables view' but returns 0 with NSLog and imagePickerController.cameraFlashMode

NSLog(@"current cameraFlashMode=%d", imagePickerController.cameraFlashMode); //returns 0 (iphone 4)

log and console debug from iphone4

However on the iphone 5 the value is accessible without problem:

NSLog(@"current cameraFlashMode=%d", imagePickerController.cameraFlashMode); //returns 1 (iphone 5)
manar
  • 151
  • 8

0 Answers0