I am developing an iPhone application in which i have to change the oreintation to landscapeleft and landscaperight.Its working in iPhone 4 but not in iPhone 5.Please let me know how to do for ios 6.The piece of code i am using is below.

Thanks,I used your code but it didnt work,Is there any other places i have to make changes.
–
user1746965Nov 5 '12 at 11:57

try adding code which I have added in EDIT section in my answer
–
P.JNov 5 '12 at 12:01

Thanks but i added the code you gave me but still its not working.The code i added is -(NSUInteger)supportedInterfaceOrientations { return (UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight); } - (BOOL)shouldAutorotate { return YES; } Is there any other way to do this.
–
user1746965Nov 5 '12 at 12:10

is you application using presentViewController or presentModalViewController?
–
P.JNov 5 '12 at 12:24

It doesn't work as nicely as it was in IOS6, I had the same issue.Since they introduced new rotation, but the old way of running navigation controller(because my app needed to support 4.3 as well) does make it very hard.