views:

318

answers:

0

Hi!

I'm trying to find the answer and cannot believe that this problem is not widely and clearly explained.

It's a quick question. Navigation based application, two view controllers, I want to autorotate my interface to landscape/portrait whenever used rotate his device.

Autorotation works when 1st view controller is displayed. 2nd view controller is only displayed in the same interface orientation as the 1st view has been shown when presenting 2nd. When 2nd view controller is displayed autorotation doesn't work as long as I return to 1st view controller.

Subclassed UINavigationController and 1st and 2nd view controller, all of them has the method: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return YES; }

Cannot this simple autorotation (like in Messages application) be obtained by some simple steps? Or do I have to receive the "orientation changed" messages and rotate my interface changing the frame from 320x480 to 480x320 and CGAffineTransformMakeRotation ?

Thanks Kris