title: When i changing orientation my view's height and width are not changed
body: <p>I have use one view in sub view of Default view. I am trying to set its height and width same as super view, when it change orientation.First when app loads portrait mode,then this sub view take perfect height-width but when second time we change to portrait mode it is not change height and width.
  In Load:-</p>
  
  <pre><code>[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
      [[NSNotificationCenter defaultCenter]
       addObserver:self selector:@selector(orientationChanged:)
       name:UIDeviceOrientationDidChangeNotification
       object:[UIDevice currentDevice]];
  </code></pre>
  
  <p>Method:-</p>
  
  <pre><code>- (void) orientationChanged:(NSNotification *)note
  {
      UIDevice * device = note.object;
      switch(device.orientation)
      {
          case UIDeviceOrientationPortrait:
              NSLog(@"Portrait");
              NSLog(@"View Height %f",self.view.frame.size.height);
              NSLog(@"View Width%f",self.view.frame.size.width);
  
              view1.frame=CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, self.view.frame.size.height);
  
              NSLog(@"View1 Height %f",view1.frame.size.height);
              NSLog(@"View1 Width%f",view1.frame.size.width);
  
              break;
  
          case UIDeviceOrientationLandscapeRight:
              NSLog(@" LanScapRight");
  
  
               view1.frame=CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.height, self.view.frame.size.width);
  
  
  
              break;
          case UIDeviceOrientationLandscapeLeft:
  
              NSLog(@" LandScapLeft");
  
              view1.frame=CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, self.view.frame.size.height);
  
  
          default:
              view1.frame=CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, self.view.frame.size.height);
  
  
              NSLog(@"Default");
  
              //view1.frame=CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.height, self.view.frame.size.width);
  
  
              break;
      };
  }
  </code></pre>
  
  <p>Output:-(Problem)</p>
  
  <pre><code>2016-02-20 01:29:15.907 Editing[4999:95632] Portrait
  [![2016-02-20 01:29:15.910 Editing\[4999:95632\] View Height 568.000000
  2016-02-20 01:29:15.910 Editing\[4999:95632\] View Width320.000000
  2016-02-20 01:29:15.911 Editing\[4999:95632\] View1 Height 568.000000
  2016-02-20 01:29:15.912 Editing\[4999:95632\] View1 Width320.000000
  2016-02-20 01:29:39.090 Editing\[4999:95632\] LanScapRight
  2016-02-20 01:29:40.364 Editing\[4999:95632\] Default
  2016-02-20 01:29:41.645 Editing\[4999:95632\] LandScapLeft
  2016-02-20 01:29:41.646 Editing\[4999:95632\] Default
  2016-02-20 01:29:43.316 Editing\[4999:95632\] Portrait
  2016-02-20 01:29:43.317 Editing\[4999:95632\] View Height 320.000000
  2016-02-20 01:29:43.317 Editing\[4999:95632\] View Width568.000000
  2016-02-20 01:29:43.317 Editing\[4999:95632\] View1 Height 320.000000
  2016-02-20 01:29:43.318 Editing\[4999:95632\] View1 Width568.000000]
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/MBsmL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MBsmL.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/fGwbv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fGwbv.png" alt="enter image description here"></a></p>