I have a UIView control in the nib file that I am working on. In that UIView I am able to place other nib files. When the iPad is rotated the -(void)deviceOrientationChanged:(NSNotification *)note{ method gets executed and I resize the UIView depending if the iPad entered landscape or portrait mode. In the subclass (the nib file that is in the UIView controll) I need to know if the iPad enteres landsape mode or portrait mode as well. Bellow is a picture demonstrating the nib file that contains a UIView control and that UIView control containing another nib file:

green rectangle is a UIView control and inside I have placed another xib file.
So I placed the same delegate - (void)deviceOrientationChanged:(NSNotification *)note{ . the problem when I do that is that sometimes the subview delegate get’s executed and the other delegate does not. That only happens on the real iPad and not in the simulator. If the iPad enters landscape mode I would like both delegates to get executed. Most of the time this is not a problem but if I tilt the iPad a little bit just one delegate will get executed. That’s why I was thinking about calling a method in the subclass when its frame get’s resized. Also I know that I can call a method from the green nib file but this is like a powerpoint presentation where there are about 60 slides therefore I am just changing the view’s dinamicaly. In c# I would be able to call a method of a dynamic data type using reflection. I don’t konw if something similar exist for the iPhone.
IN SHORT I WANT BOTH DELEGATES (THE ONE FROM THE NIB FILE THAT I AM WORKING WITH AND THE SUBVIEW OF THE UIVIEW CONTROL) TO GET EXECUTED AT THE SAME TIME.
1 Answer