title: presentPopoverFromRect is displaying a popover sideways on rotation
body: <p>-I have a UIView.<br>
  -This UIView has a UIButton that when clicked makes a UIAlertView appear.<br>
  -Within this UIAlertView I have another UIButton that when clicked calls buttonClicked:<br>
  -Within this buttonClicked: method, I call presentPopoverFromRect with a custom view inside. (hourKeyboard is the custom view)</p>
  
  <pre><code>-(void)buttonClicked:(id)sender
  {
      if(self.hourKeyboard==nil)
      {
          self.hourKeyboard = [[HourKeyboardViewController alloc] init];
          self.hourKeyboardPopover = [[UIPopoverController alloc] initWithContentViewController:self.hourKeyboard];
      }
  
      [self.hourKeyboardPopover presentPopoverFromRect:[sender bounds] inView:sender permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];
  }
  </code></pre>
  
  <p>In normal portrait mode, this works great.  The popover spawns just to the right of the button, with the arrow correctly pointing left to the button.</p>
  
  <p>There's 2 problems that arrises:<br>
  1) While this popover is visible, when you rotate the screen the popover rotates slightly incorrectly (it doesn't reposition it's own x and y position)<br>
  2) If the popover is not being shown.  If you rotate the screen, then call "buttonClicked", the popover will appear, however, its being shown sideways above the button with the arrow pointing "down" towards the button (technically left in relation to the sideways popover view).  If you dismiss it, rotate the screen, then call "buttonClicked", the popover now appears upside down with the button pointing "right" to the button (again, technically left in relation to the sideways popover view)!  Repeat to make it sideways again, then right-side up again.</p>
  
  <p>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-</p>
  
  <p>My thinking:  </p>
  
  <p>1) I believe I can just reposition the x and y, however, I've also read that you should dismiss the popover and present it over again on a rotation.  I'll see if I can get the first one working, however I'm more concerned about the second problem.</p>
  
  <p>2)  I have no idea how to fix this rotation issue.  It seems that when you rotate to landscape without the popover being visible.  And then you call presentPopoverFromRect, the popover is created with the iPad thinking it's still in portrait view by mistake.  That's the behavior it's giving, however, I'm not sure how to make the iPad not make this mistake.</p>
  
  <p>-=-=-=-=-=-=-=-=-=</p>
  
  <p>Thanks again for any help you can provide!</p>
  
  <p>-=-=-</p>
  
  <p>Slight Update:<br>
  1) It was easy to just dismiss the popover from the main view on rotation.  And this seems to be the general way everyone deals with this issue. </p>
  
  <p>2) Trying out various things such as changing the frame, using CGAffineTransformMakeRotation, and others...but no luck thus far</p>
  
  <p>-=-=-</p>
  
  <p>Another Update:</p>
  
  <p>2) After a lot of testing, it seems to be a direct issue with UIAlertView.  If I place the view within UIAlertView (currently doing), the AlertView doesn't tell the popover that the screen is rotated...thus creating the issue</p>
  
  <p>It looks like the only way to fix this is to drop the UIAlertView completely.  Instead of showing the UIAlertView, I'll disable the various background views manually (like Alert View was doing) and then show a custom UIView that looks darn similar to the AlertView.  From there, I should be able to show the popover without any issues.  I'll let yea know how it turns out.</p>
  
  <p>-=-=-=-=-=-=-=-</p>
  
  <p>Final Solution:</p>
  
  <p>I ended up just creating my own view, and having that view imitate a UIAlertView.  Then when I spawned the popover, I placed it in the root view controller.  Worked much MUCH better, but required more work since I had to manually create my own View instead of the premade UIAlertView.  Either way, apparently UIAlertView fails at telling a UIPopoverover subview what rotation it is in.</p>