WhichWayIsUp sample app
/*Can somebody please explain how shouldAutorotateToInterfaceOrientation is receiving its orientation values in the WhichWayIsUp, Apple supplied, sample code below? Thank you very much!
*/
#import "WhichWayIsUpAppDelegate.h"
#import "CrateViewController.h"
@implementation WhichWayIsUpAppDelegate
@synthesize window;
@synthesize crateViewController;
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// add the CreateViewController's view to the window as a subview
[window addSubview:crateViewController.view];
}
- (void)dealloc {
// release objects defined at the top-level of the nib file
[crateViewController release];
[window release];
[superdealloc];
}
@end
#import "CrateViewController.h"
@implementation CrateViewController
// Subclasses override this method to define how the view they control will respond to device rotation
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrienta tion {
returnYES;
}
@end
#import <UIKit/UIKit.h>
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}
MacBook Pro, Mac OS X (10.6.7)