Iphone 方向仅在cameraoverlay视图中处于横向模式

Iphone 方向仅在cameraoverlay视图中处于横向模式,iphone,ipad,camera,Iphone,Ipad,Camera,我只想在横向模式下打开Cameraoverlay视图…但是这段代码给了我错误的错误提示 { self.imagePickerController = [[[UIImagePickerController alloc] init ] autorelease]; imagePickerController.view.frame=CGRectMake(0, 0, 1024, 768); self.imagePickerController.delegate = self; [[UIDevi

我只想在横向模式下打开Cameraoverlay视图…但是这段代码给了我错误的错误提示

{      
self.imagePickerController = [[[UIImagePickerController alloc] init ] autorelease];
imagePickerController.view.frame=CGRectMake(0, 0, 1024, 768);
self.imagePickerController.delegate = self;
[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];

//Set Notifications so that when user rotates phone, the orientation is reset to landscape.
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];

//Refer to the method didRotate:   
[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(didRotate:)
                                             name:@"UIDeviceOrientationDidChangeNotification" object:nil];

//Set the picker source as the camera   
self.imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;

//Bring in the picker view   
[self presentModalViewController:self.imagePickerController animated:YES];
}
请解决这个问题。。。
提前感谢

进入产品>编辑方案>启用僵尸


这将为您提供有关异常的更多描述。

错误访问发生在哪里[[UIDevice currentDevice]setOrientation:UIInterfaceOrientation和ScapeRight];在didRotate:方法中,我使用了这个代码Hi-Tejas,如果你找到了这个问题的任何解决方案,那么请分享我要处理的相同问题。谢谢。也许你没有换账单。从上方选择“诊断”选项卡有一个复选框