title: iOS - QLPreviewController - How to stop QuickLook from Rotating?
body: <p>I have QuickLook (QLPreviewController) almost working how I want it, but because of the images characteristics I don't want it to rotate into portrait orientation.I have it configured in the "shouldAutoRotateToInterfaceOrientation" method to only return yes for landscape rotations (see code below for details) but it is still rotating to portrait.</p>
  
  <p><strong>Note:</strong> The shouldAutoRotateToInterfaceOrientation is a direct copy that is used in all of my view controllers for this project and it is working in the other view controllers.</p>
  
  <pre><code>//
  //  documentViewer.m
  //
  
  #import "DocumentViewer.h"
  
  @implementation DocumentViewer
  
  @synthesize documents;
  
  // Override to allow orientations other than the default portrait orientation.
  - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
      if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft)
          return YES;
      else if (interfaceOrientation == UIInterfaceOrientationLandscapeRight)
          return YES;
      else 
          return NO;
  }
  
  - (void)viewDidLoad {
      [super viewDidLoad];
  
  }
  
  //-(void)viewWillAppear:(BOOL)animated {
  //  
  //  self.userInteractionEnabled = YES;
  //}
  
  //Nessary for Enabling User Interaction
  - (BOOL)canBecomeFirstResponder {
      return YES;
  }
  
  -(void) createList:(NSString *) document {
  
      documents =     [[NSArray arrayWithObjects:document, nil] retain];
  }
  
  -(NSInteger) numberOfPreviewItemsInPreviewController: (QLPreviewController *) controller {
  
      return [documents count];
  }
  
  - (id &lt;QLPreviewItem&gt;) previewController: (QLPreviewController *) controller previewItemAtIndex: (NSInteger) index {
  
      return [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:[documents objectAtIndex:index] ofType:nil]];
  }
  @end
  </code></pre>