tags:

views:

27

answers:

1

I have 1 UIViewController.

in that i wrote,

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
   NSLog(@"A");
} in UIViewController.

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
    NSLog(@"b");
}

but this method is not called why is it so?

+1  A: 

You may need to do two things:

  1. Tell device to track orientation changes: call [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
  2. Implement your View controllers -shouldAutorotateToInterfaceOrientation method - return YES for orientations you want to support.
Vladimir