我在Cocoa Touch中有一个视图控制器,可以检测设备何时旋转,并在它具有的两个视图控制器的视图之间切换:横向和纵向.
我希望UIViewControllersin in能够以FRRRotatingViewController类似的方式访问它,因为所有人都UIViewControllers可以访问UINavigationController它们.
所以我创建了一个具有属性的UIViewController子类(FRRViewController)rotatingViewController.
我也修改了FRRRotatingViewController,所以它需要FRRViewControllers而不是简单UIViewControllers.
不幸的是,当我包括FRRRotatingViewController.h在FRRViewController.h(反之亦然),我似乎进入一个圆形的进口问题.我不知道如何解决它.有什么建议?
这是代码:
//
// FRRViewController.h
#import <UIKit/UIKit.h>
#import "FRRRotatingViewController.h"
@interface FRRViewController : UIViewController
@end
//
// FRRRotatingViewController.h
#import <UIKit/UIKit.h>
#import "FRRViewController.h"
@class FRRRotatingViewController;
@protocol FRRRotatingViewControllerDelegate
-(void) FRRRotatingViewControllerWillSwitchToLandscapeView: (FRRRotatingViewController *) sender;
-(void) FRRRotatingViewControllerWillSwitchToPortraitView: (FRRRotatingViewController *) sender;
@end
@interface FRRRotatingViewController : FRRViewController {
// This is where I get the error:Cannot find …Run Code Online (Sandbox Code Playgroud)