Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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)

Posted on Jul 16, 2011 3:17 AM

Reply
4 replies

Jul 16, 2011 8:59 AM in response to Conundrum

Can somebody please explain how shouldAutorotateToInterfaceOrientation is receiving its orientation values in the WhichWayIsUp

It's really not receiving anything, it's only telling the system that all orientations are supported by the controller. The rest is handled by auto-resizing settings in the IB (XIB/NIB).

WhichWayIsUp sample app

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.