Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

spaceman816

macrumors member
Original poster
Jul 29, 2009
30
0
For some reason, none of the views in the app I am writing will rotate. I return YES in the shouldAutorotate method, but when I open them in iphone simulator and try to rotate, the views stay in place.
Any idea why this may be happening?

Thanks.
 
Please?

I'm having a lot of trouble with this. All my other apps rotate quite easily, but I can't seem to get any of the views to rotate here.
 
Are these views contained within a navigation controller or tab bar controller?

It's a utility application, and on the flipside the views are contained within a navigation controller.
But none of these views (even the front) will rotate.
 
It's a utility application, and on the flipside the views are contained within a navigation controller.
But none of these views (even the front) will rotate.
I just created a project using the Utility Application template, uncommented and changed the shouldAutorotateToInterfaceOrientation: methods in both MainViewController and FlipsideViewController to return YES and it rotates fine. So, let's try to figure out how your app is different from the template in that even the front (main) view doesn't autorotate. Did you start with the Utility Application template?
 
I just created a project using the Utility Application template, uncommented and changed the shouldAutorotateToInterfaceOrientation: methods in both MainViewController and FlipsideViewController to return YES and it rotates fine. So, let's try to figure out how your app is different from the template in that even the front (main) view doesn't autorotate. Did you start with the Utility Application template?

Yes. I started with a Utility template- the front side is just a table view, and the backside is a navigation controller in which the user downloads or edits the table view.

This is the header file for my front side:
Code:
#import <UIKit/UIKit.h>
#import "/usr/include/sqlite3.h"

@class RamazSchedulerAppDelegate;

@interface MainViewController : UIViewController
	<UITableViewDelegate, UITableViewDataSource> {
	
	NSArray *data;
	NSDictionary *timesDict;
	NSDictionary *selectedTimesDict;
		
	NSArray *daysData;
	NSDictionary *daysDict;
	NSDictionary *selectedDaysDict;
	NSDictionary *selectedPeriodDict;
	NSString *selectedDay;
	
	UISegmentedControl *times;
	UISegmentedControl *days;
	IBOutlet UITableView *table;
	IBOutlet UIButton *infoButton;
	NSInteger currentPeriod;
	
	sqlite3 *database;
	NSTimer *timer;
				
}

@property (nonatomic, retain) NSArray *data;
@property (nonatomic, retain) NSDictionary *timesDict;
@property (nonatomic, retain) NSDictionary *selectedTimesDict;
@property (nonatomic, retain) NSArray *daysData;
@property (nonatomic, retain) NSDictionary *daysDict;
@property (nonatomic, retain) NSDictionary *selectedDaysDict;
@property (nonatomic, retain) NSDictionary *selectedPeriodDict;
@property (nonatomic, retain) NSString *selectedDay;
@property (nonatomic, retain) UISegmentedControl *times;
@property (nonatomic, retain) UISegmentedControl *days;
@property (nonatomic, retain) UITableView *table;
@property (nonatomic, retain) UIButton *infoButton;
@property (nonatomic) NSInteger currentPeriod;
@property (nonatomic, retain) NSTimer *timer;

-(IBAction)backgroundClick:(id)sender;
-(IBAction)switchWindow:(id)sender;
-(void)highlightCell:(NSTimer *)timer;



@end

And this is the shouldAutorotate method from the .m:
Code:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
	// Return YES for supported orientations
	return YES;
}

Note: none of the views in the app (even ones that are just a single picture) will rotate when i change their autorotate methods to return YES
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.