views:

409

answers:

2

I have created the one rootviewcontroller , and then make that geosensitive by writing

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{
    return YES;
}

In rootviewcontroller willAnimateSecondHalfOfRotationFromInterfaceOrientation method is called and images are resizing.

I also have some views on it, but when I rotate the screen the view will be rotate but the images are not resizing though I have used the same

-(void)willAnimateSecondHalfOfRotationFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation duration:(NSTimeInterval)duration
{
    UIInterfaceOrientation toOrientation = self.interfaceOrientation;
}

method but it cannot called. So, what can I do? Please help me.

A: 

I have the same problem!

I place a break point there but it doesn't work. The method is not called, why?

Walker
+1  A: 

This got me too. I think you'll find the answer if you look at that header file for UIViewController. There are comments in there which state that you may override EITHER

  • (void)willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:

OR any of the following

  • (void)willAnimateFirstHalfOfRotationToInterfaceOrientation:duration:
  • (void)didAnimateFirstHalfOfRotationToInterfaceOrientation:
  • (void)willAnimateSecondHalfOfRotationFromInterfaceOrientation: duration:

Apparently if you override the first one, that's the only one that will be called. If you want feedback from each stage of the rotation, use any of the ones in the 2nd set, but LEAVE OUT the first one.

Cruinh