Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting "Using two-stage rotation animation" warning with UIImagePickerController

I wrote simple code to test UIImagePickerController:

@implementation ProfileEditViewController

- (void)viewDidLoad {
  [super viewDidLoad];

  photoTaker_ = [[UIImagePickerController alloc] init];
  photoTaker_.delegate = self;
  photoTaker_.sourceType = UIImagePickerControllerSourceTypeCamera;
  photoTaker_.showsCameraControls = NO;
}

- (void)viewDidAppear: (BOOL)animated {
  [self presentModalViewController: photoTaker_ animated: NO];
}

@end

And I'm getting strange warnings like the following:

2010-05-20 17:53:13.838 TestProj[2814:307] Using two-stage rotation animation. To use the smoother single-stage animation, this application must remove two-stage method implementations. 2010-05-20 17:53:13.849 TestProj[2814:307] Using two-stage rotation animation is not supported when rotating more than one view controller or view controllers not the window delegate

Got any idea what this is about? Thanks a lot in advance!

like image 653
Kay Avatar asked May 21 '10 01:05

Kay


2 Answers

This message will appear if you are presenting the UIImagePickerController within another UIViewController. Because it isn't pushed like a UINavigationController stack, there is confusion at the UIWindow level. I don't know if the warning is a problem, but to eliminate the warning you can do the following:

// self = a UIViewController  
//  

- (void) showCamera  
{  
    cameraView = [[UIImagePickerController alloc] init];  
    [[[UIApplication sharedApplication] keyWindow] setRootViewController:cameraView];  
    [self presentModalViewController:cameraView animated:NO];  
}   

- (void) removeCamera  
{  
    [[[UIApplication sharedApplication] keyWindow] setRootViewController:self];  
    [self dismissModalViewControllerAnimated:NO];  
    [cameraView release];  
}  
like image 93
John Carter Avatar answered Oct 18 '22 23:10

John Carter


Perhaps you are adding the root UIViewController's view as a subview of the window instead of assigning the view controller to the window's rootController property?

like image 28
rpetrich Avatar answered Oct 19 '22 00:10

rpetrich