Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
377 views
in Technique[技术] by (71.8m points)

iphone - 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!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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];  
}  

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...