Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-03-2012, 11:04 PM   #1 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 47
john4mac is on a distinguished road
Default SWITCHING VIEWS LANDSCAPE! HELP!

In my application, I have two xibs set to landscape, and the app's info is set to landscape, but when I switch from view 1 to view 2 it makes it portrait on view 2.

I posted a video showing what's happening. The view switch happens at the first second. Sorry. You may need to rewatch. The rest of the video is the same issue.

Orientation iPhone SDK Issue - YouTube

.h for view 1

Code:
- (IBAction)viewSwitchSingle:(id)sender;
.m for view 1


Code:
//Importing of other view controllers
#import "SinglePlayer.h"

@implementation ViewController

//Switching of views from the menu
- (IBAction)viewSwitchSingle:(id)sender {
    
    SinglePlayer *sp = [[SinglePlayer alloc] initWithNibName:@"SinglePlayer" bundle:nil];
                          sp.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
                          [self presentModalViewController:sp animated:NO];
}
WITH THE MESS IS GOING BACK TO PORTRAIT? HOW DO I KEEP IN IN LANDSCAPE? PLEASE HELP!
john4mac is offline   Reply With Quote
Old 02-03-2012, 11:18 PM   #2 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 386
SoulRed12 is on a distinguished road
Default

Are you implementing both view controllers' shouldAutorotateToInterfaceOrientation: method? It fires whenever the device senses a change in orientation and sends a message to the app to check whether the app should rotate with it, based on the orientation the device is in.

Code:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
     return (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight);
}
This will make it so that the view controllers know it's only supposed to turn when the interface orientation is either Landscape Left or Landscape Right (because the expression in the parenthesis will only return YES when the orientation is one of those two).
__________________
HEY! Was this post helpful?
If so, it would be MUCH appreciated if you'd just click on one of these apps:



MyD
Take 1 minute to set up your MyD and you'll always be able to prove you own your device!

Membrik
Test your memory by sliding tiles to match chains of increasing difficulty.

©2011 Dardom Productions | Like us on Facebook!
SoulRed12 is offline   Reply With Quote
Old 02-04-2012, 10:50 AM   #3 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 47
john4mac is on a distinguished road
Default

That was indeed the issue! Thank you so much!
john4mac is offline   Reply With Quote
Old 02-05-2012, 03:04 AM   #4 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 386
SoulRed12 is on a distinguished road
Default

Glad to help!
__________________
HEY! Was this post helpful?
If so, it would be MUCH appreciated if you'd just click on one of these apps:



MyD
Take 1 minute to set up your MyD and you'll always be able to prove you own your device!

Membrik
Test your memory by sliding tiles to match chains of increasing difficulty.

©2011 Dardom Productions | Like us on Facebook!
SoulRed12 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 397
18 members and 379 guests
Apptronics RBC, Atatator, chiataytuday, dre, FrankWeller, gwelmarten, ipodphone, jeroenkeij, jleannex55, kukat, LunarMoon, MAMN84, n00b, pbart, reficul, Retouchable, Sami Gh, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,124
Posts: 402,909
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:13 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0