views:

133

answers:

1

Hey there all,

I've got an iPad app that I absolutely need to have in just landscape, I know the situation on the suggestions but for this app it needs to be landscape.

Now here's my problem.

I have editted my .plist file to support both landscape left and landscape right in the appropriate manner and have put an autorotate snippet into my code, however if I have this

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
/*if (autorotateOrientation && tapViewOrientation != interfaceOrientation && !insecureKeyboardWarningDialog) {
    tapViewOrientation = interfaceOrientation;
    [[NSUserDefaults standardUserDefaults] setInteger:tapViewOrientation forKey:kDefaultKeyTapViewOrientation];
*/
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);

[self prepareTapView];

// return NO; }

I get only landscape left (obviously)

if I have this

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
/*if (autorotateOrientation && tapViewOrientation != interfaceOrientation && !insecureKeyboardWarningDialog) {
    tapViewOrientation = interfaceOrientation;
    [[NSUserDefaults standardUserDefaults] setInteger:tapViewOrientation forKey:kDefaultKeyTapViewOrientation];
*/
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft, UIInterfaceOrientationLandscapeRight);

[self prepareTapView];

// return NO; }

I get all four orientations. Now I could just come upw tih an option for the portrait orientations however truth be told it would be ugly and non functional hence my desire to work for landscape only in this particular instance.

Can anyone suggest what I'm doing wrong and how to limit myself to landscape only, but both forms of landscape?

+1  A: 
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
hgpc
Genius. I knew it had to be something painfully simple. Many thanks.
David26th