Question : Why does imagePickerController.cameraFlashMode always return 0 on iphone 4 and return correct values using iphone 5?
I launched my UIImagePickerController and set the camera to FlashMode 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 starts:

As you can see in the screenshot below, the value of cameraFlashMode is true in the "representation of variables", but returns 0 using NSLog and imagePickerController.cameraFlashMode
NSLog(@"current cameraFlashMode=%d", imagePickerController.cameraFlashMode);

However, on iphone 5, the value is available without problems:
NSLog(@"current cameraFlashMode=%d", imagePickerController.cameraFlashMode);
manar source
share