方向仅在相机叠加视图中以横向模式显示

时间:2012-05-30 13:04:51

标签: iphone ipad camera

我只想在横向模式下打开Cameraoverlay视图......但是这段代码给了我BAD_Excess ..

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

请解决这个问题...... 谢谢你提前

1 个答案:

答案 0 :(得分:0)

转到产品>编辑方案>启用僵尸

这将为您提供有关您的例外情况的更多说明。