Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

JamesFoote

macrumors regular
Original poster
Aug 5, 2008
109
0
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)
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
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?
 

JamesFoote

macrumors regular
Original poster
Aug 5, 2008
109
0
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!
 

mtgred

macrumors newbie
Mar 30, 2008
11
0
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/l...S/AutorotatingViews/chapter_11_section_1.html
 

Cromulent

macrumors 604
Oct 2, 2006
6,802
1,096
The Land of Hope and Glory
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.
 

Niiro13

macrumors 68000
Feb 12, 2008
1,719
0
Illinois
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 ;).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.