Thank you for reading,
I am making a camera timer app, and when the timer hits 0 a picture is meant to be taken. However, it isn’t. :c.
HERE is the code for showing the PickerController and the Overlay for my new controls. (ViewDidLoad method is too early to load this.)
-(void)viewDidAppear:(BOOL)animated{
overlayView.hidden = false;
imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
[imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera];
[self presentViewController:imagePicker animated:YES completion:NULL];
imagePicker.showsCameraControls = NO;
imagePicker.cameraOverlayView = overlayView;
}
HERE is the code for when the timer hits 0 and a picture is meant to be taken.
//cameraTimeInt is the timer//
if(cameraTimeInt ==0){
//timerDisplay is the picture displaying the countdown to 0//
[timerDisplay setImage:NULL];
[imagePicker takePicture];
}
HERE is the code when you click the ‘takepicture’ button.
-(IBAction)takePicture:(id)sender {
cameraTimeInt = timeSlider.value;
NSTimer *timerStart = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(timerTickStart:) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:timerStart forMode:NSDefaultRunLoopMode];
}
I know the code is a bit sloppy, but if anyone has any ideas, it would be GREATLY appreciated 🙂
ALSO the error I am getting is this:
CameraTimer[392:907] UIImagePickerController: ignoring request to take picture; image is already being captured or camera not yet ready.
It appears to be trying to take two images, as I hear the clicking (camera take picture noise) twice.
Editted