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
Demi-God (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
Demi-God (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

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

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
How do you check to see if you're in 64-bit mode? Boesky Mac OS X 11 Nov 5, 2009 04:43 PM
How do you use Stealth Mode in Colloquy? siys Mac Applications and Mac App Store 0 Sep 27, 2008 05:52 PM
How do you get out of restore mode? aerospace iPhone Tips, Help and Troubleshooting 0 Mar 23, 2008 08:19 AM
How do you get full screen mode on Firefox with a mac? streetsmart1980 Mac Basics and Help 5 Jan 18, 2008 05:04 PM
How do you enable Clamshell mode? Chef Medeski Macintosh Computers 6 Aug 7, 2005 12:11 PM


All times are GMT -5. The time now is 06:23 AM.

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

Mobile Version | Fixed | Fluid | Fluid HD
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Privacy / DMCA contact / Affiliate and FTC Disclosure
Copyright 2002-2013, MacRumors.com, LLC