Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Aug 21, 2008, 08:43 PM   #1
JamesFoote
Banned
 
Join Date: Aug 2008
How do you support landscape mode?

I'm almost done my first app, but I want to be able to know how to support landscape mode.

(The app displays an RSS feed)
JamesFoote is offline   0 Reply With Quote
Old Aug 23, 2008, 01:33 PM   #2
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
You need to implement shouldAutorotateToInterfaceOrientation:
kainjow is offline   0 Reply With Quote
Old Aug 23, 2008, 04:38 PM   #3
TheZimm
macrumors 6502a
 
TheZimm's Avatar
 
Join Date: Jul 2008
Send a message via AIM to TheZimm
Quote:
Originally Posted by kainjow View Post
You need to implement shouldAutorotateToInterfaceOrientation:
Im a total noob to this stuff, where would you add that
__________________
iPhone 3G 16Gig Black 2.2.1
Zym Blog - iPhone App Reviews

TheZimm is offline   0 Reply With Quote
Old Aug 23, 2008, 04:45 PM   #4
music.addict411
Banned
 
Join Date: Jan 2007
Location: Vancouver, Canada
yeh

yeah I second that. All I need to know now is where to add it.
music.addict411 is offline   0 Reply With Quote
Old Aug 23, 2008, 04:46 PM   #5
JamesFoote
Thread Starter
Banned
 
Join Date: Aug 2008
i

and I guess I third it.

Thanks everyone youre all a huge help!
JamesFoote is offline   0 Reply With Quote
Old Aug 23, 2008, 04:49 PM   #6
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
Have you tried using the documentation. It's not there for you to ignore whilst you post questions on here.

I put "shouldAutorotateToInterfaceOrientation" into the search box and the top page returned was titled "Autorotating views". Have you tried, you know, reading it?
robbieduncan is offline   0 Reply With Quote
Old Aug 23, 2008, 05:05 PM   #7
JamesFoote
Thread Starter
Banned
 
Join Date: Aug 2008
I read the entire guide. It makes next to no sense. I understand that I have to add the code:

@property(nonatomic, readonly) UIInterfaceOrientation interfaceOrientation

BUT - I have no idea where I put it in. It says that it needs to be declared in a place that I can't even find!
JamesFoote is offline   0 Reply With Quote
Old Aug 25, 2008, 07:15 AM   #8
mtgred
macrumors newbie
 
Join Date: Mar 2008
Location: Brussels, Belgium
The method is in your main ViewController. The code for the method is actually already generated for you when you generate a new project with view.

Replace:

- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

with:

- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
{
return YES;
}

For more info:
http://developer.apple.com/iphone/li...section_1.html
mtgred is offline   0 Reply With Quote
Old Aug 25, 2008, 07:59 AM   #9
Cromulent
macrumors 603
 
Cromulent's Avatar
 
Join Date: Oct 2006
Location: The Land of Hope and Glory
Quote:
Originally Posted by JamesFoote View Post
I read the entire guide. It makes next to no sense. I understand that I have to add the code:

@property(nonatomic, readonly) UIInterfaceOrientation interfaceOrientation

BUT - I have no idea where I put it in. It says that it needs to be declared in a place that I can't even find!
You should probably take the time to learn the language then, rather than just trying to copy and paste code. I don't mean to sound harsh, but if you need someone to tell you where to place some code then you don't know the language and ultimately you'll produce poor software.

I'm not even attempting to write an iPhone application until I feel like I have a good strong grasp of Objective-C and the Cocoa APIs and I have the advantage of knowing C already.
__________________
Neural Advance - Mac OS X, UNIX and Windows Development
Last.fm Profile | Extreme Metal Reviews
MP 4x 2.66Ghz Xeons / 6GB RAM / 640GB + 500GB + 750GB + 1TB HDDs / ATI Radeon 4870 / iPad 3
Cromulent is offline   -1 Reply With Quote
Old Aug 25, 2008, 11:40 AM   #10
Niiro13
macrumors 68000
 
Join Date: Feb 2008
Location: Illinois
Send a message via AIM to Niiro13 Send a message via MSN to Niiro13 Send a message via Yahoo to Niiro13
Quote:
Originally Posted by JamesFoote View Post
I read the entire guide. It makes next to no sense. I understand that I have to add the code:

@property(nonatomic, readonly) UIInterfaceOrientation interfaceOrientation

BUT - I have no idea where I put it in. It says that it needs to be declared in a place that I can't even find!
In Mac programming, something of that nature would commonly be found in the header file .
Niiro13 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
How to activate landscape mode in iOS 7? ozziegn iOS 7 2 Sep 25, 2013 02:21 PM
Messages not going into landscape mode brayhite iPhone 0 Sep 25, 2012 03:47 PM
So what does the keyboard look like in landscape mode now? krashx7 iPhone 5 Sep 16, 2012 05:46 PM
So this is how photos and keyboard looks in landscape mode djrod iPhone 9 Sep 13, 2012 11:19 AM
When held in landscape mode..... Enlightenment1 iPad 25 Jun 13, 2012 01:50 PM

Forum Jump

All times are GMT -5. The time now is 06:12 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC