Objective c 未调用shouldAutorotateToInterfaceOrientation

Objective c 未调用shouldAutorotateToInterfaceOrientation,objective-c,xcode4,ios5,Objective C,Xcode4,Ios5,您好,我现在对viewcontroller的方向有问题。下面是我的.h文件 @interface IPad_HomeViewController : UIViewController <UINavigationControllerDelegate>{ UIAlertView *alertWithYesNoButtons; } @property (weak, nonatomic) IBOutlet UILabel *lblStatus; @end 然后我做了一个断点。我意

您好,我现在对viewcontroller的方向有问题。下面是我的.h文件

@interface IPad_HomeViewController : UIViewController <UINavigationControllerDelegate>{
    UIAlertView *alertWithYesNoButtons;
}
@property (weak, nonatomic) IBOutlet UILabel *lblStatus;

@end
然后我做了一个断点。我意识到应该自动旋转指点器面方向完全没有被调用。不知道为什么没有人叫它

请告诉我。
谢谢

我想这是因为您的UINavigationController负责处理呼叫。执行以下操作以将其发送回viewController

- (BOOL)shouldAutorotate
{
    return [[self.viewControllers lastObject] shouldAutorotate];
}

- (NSUInteger)supportedInterfaceOrientations
{
    return [[self.viewControllers lastObject] supportedInterfaceOrientations];
}

// pre-iOS 6 support
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    return (toInterfaceOrientation == UIInterfaceOrientationPortrait);
}

我想这是因为你的UINavigationController负责处理通话。执行以下操作以将其发送回viewController

- (BOOL)shouldAutorotate
{
    return [[self.viewControllers lastObject] shouldAutorotate];
}

- (NSUInteger)supportedInterfaceOrientations
{
    return [[self.viewControllers lastObject] supportedInterfaceOrientations];
}

// pre-iOS 6 support
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    return (toInterfaceOrientation == UIInterfaceOrientationPortrait);
}

iOS 5和iOS 6之间的轮换支持发生了很大变化


转到项目的目标摘要页面,选中“iPhone/Ipod部署信息”和“支持的界面方向”。您启用了设备轮换吗?

在iOS 5和iOS 6之间,轮换支持发生了很大变化


转到项目的目标摘要页面,选中“iPhone/Ipod部署信息”和“支持的界面方向”。您启用了设备旋转吗?

您用来显示该视图的方法是指添加子视图或PresentModalViewController。您用来显示该视图的方法是指添加子视图或PresentModalViewController。感谢Roland,我在supportedInterfaceOrientations中看到了错误。”在类型为“IPad_HomeViewController*”的对象上未找到属性“ViewController”,则“IPad_HomeViewController”不是UINavigationController或其子类。感谢Roland,我在supportedInterfaceOrientations中看到了错误。”在“IPad_HomeViewController*”类型的对象上未找到属性“ViewController”,则“IPad_HomeViewController”不是UINavigationController或其子类。