What I am having so far is
and
My logic is after hitting the RUN from xcode, willAnimateRotationToInterfaceOrientation is going to be called because I set Supported Device Orientation to be UpsideDown from Summary of MyApp.xcodeproj.Moreover, I also think that didRotateFromInterfaceOrientation should not be called because we have just started the app yet. It means there is no previous state at all.
Unfortunately, this is what I got after doing the debugger
I am getting lost now. Does anyone have any ideas about the issue, please help. Thanks.
Code:
-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
NSLog(@"willAnimateRotationToInterfaceOrientation");
if(toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
NSLog(@"PortraitUpsideDown");
// Do method A
}
else {
[[self.view subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
// Do method B
}
}
Code:
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
NSLog(@"didRotateFromInterfaceOrientation");
if( fromInterfaceOrientation == UIInterfaceOrientationPortrait || fromInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
NSLog(@"OrientationPortrait or PortraitUpsideDown");
[[self.view subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
// Do method B
}
else {
NSLog(@"From else");
[[self.view subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
// Do method A
}
}
My logic is after hitting the RUN from xcode, willAnimateRotationToInterfaceOrientation is going to be called because I set Supported Device Orientation to be UpsideDown from Summary of MyApp.xcodeproj.Moreover, I also think that didRotateFromInterfaceOrientation should not be called because we have just started the app yet. It means there is no previous state at all.
Unfortunately, this is what I got after doing the debugger
Code:
2012-02-11 12:04:08.776 MyApp[7505:10703] willAnimateRotationToInterfaceOrientation :
2012-02-11 12:04:08.776 MyApp[7505:10703] PortraitUpsideDown
2012-02-11 12:04:08.778 MyApp[7505:10703] didRotateFromInterfaceOrientation :
2012-02-11 12:04:08.779 MyApp[7505:10703] OrientationPortrait or PortraitUpsideDown