2. Open up CustomSplitViewController.h and change it so that it looks something like this:
#import <UIKit/UIKit.h>
@interface CustomSplitViewController : UISplitViewController {
}
@end
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
[super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
NSMutableArray *controllers=[NSMutableArray arrayWithArray:self.viewControllers];
UIViewController * first=[[controllers objectAtIndex:0] retain];
UIViewController * second=[[controllers objectAtIndex:1] retain];
[self setViewControllers:[NSArray arrayWithObjects:second,first,nil]];
NSLog(@"%@\n%@",first,second);
[first release];
[second release];
}
#import "CustomSplitViewController.h"
@implementation CustomSplitViewController
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
[super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
NSMutableArray *controllers=[NSMutableArray arrayWithArray:self.viewControllers];
UIViewController * first=[[controllers objectAtIndex:0] retain];
UIViewController * second=[[controllers objectAtIndex:1] retain];
[self setViewControllers:[NSArray arrayWithObjects:second,first,nil]];
NSLog(@"%@\n%@",first,second);
[first release];
[second release];
}
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations.
return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation];
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc. that aren't in use.
}
- (void)viewDidUnload {
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)dealloc {
[super dealloc];
}
0 comments:
Post a Comment