I've got an application with a primary UIViewController
, and a secondary one that is meant to be presented modally after a button is tapped.
Both of the UIViewControllers
have their own GPUImageStillCamera
with a corresponding GPUImageView
added as a subview. Everything works fine up to this point.
However, when I go to the modally presented UIViewController
and close it, the camera on my primary controller stays frozen on the last frame I left it on before presenting the second controller.
What I call in the PrimaryViewController
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
[_stillCamera resumeCameraCapture];
}
-(void)viewDidDisappear:(BOOL)animated{
[super viewDidDisappear:animated];
[_stillCamera pauseCameraCapture];
}
What I call in my SecondaryViewController
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[_stillCamera resumeCameraCapture];
}
-(void)viewWillDisappear:(BOOL)animated{
[super viewDidDisappear:animated];
[_stillCamera stopCameraCapture];
}
I'm 100% sure that the methods fire (checked with breakpoints). Logically, the first camera should just resume preview, once its viewed again, but it doesn't - it freezes at the last frame (when the the pauseCameraCapture
method is called. Is there some way to force it to refresh (beside recreating it again)? I've checked - it isn't deallocated either.
What am I missing?