Just declare the method in a category in the .h or .m file of wherever you use it.
@interface UIDevice (MyPrivateNameThatAppleWouldNeverUseGoesHere)
-(void) setOrientation:(UIInterfaceOrientation)orientation;
@end
but also Apple rejects applications which use this code.
So, use this for solution for call orienatation method.. and it works fine
UIViewController *viewController = [[UIViewController alloc] init];
[viewController setModalPresentationStyle:UIModalPresentationCurrentContext];
viewController.view.frame = CGRectZero;
[self presentModalViewController:viewController animated:NO];
[self dismissModalViewControllerAnimated:NO];
[viewController release];
sorry, if there is any mistake. i'm a fresher for iphone... :)