Thursday, 15 August 2013

Modify action without deleting superclass actions

Modify action without deleting superclass actions

The Problem
I have made a subclass of UIViewController that handles landscape mode,
then I subclassed my subclass, that is shown to the user. Now, I wan't to
add a subclass in the landscape view, and have the size the same as the
landscape view, but in order to get the frame I need to add the action
-
(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
which I also used in my first subclass. However, when I do this, it
ignores all the code in the superclass, and does that one thing (get the
frame)
What I CAN do
I can get the landscape frame with a piece of code, like [[UIScreen
mainScreen].landscapeFrame or something like that (if it exists)
Rewrite the code from the superclass in the subclass (but then, what's the
point to have a superclass?)
Any help is appreciated!

No comments:

Post a Comment