When I want to access the parent UIView
of current UIView
I declare object of parent UIView
in current UIView
and access it by assigning the parent UIView
object to current view's object property.
Is there any way to get rid of this and directly call the parent view's methods or properties?
I also tried (parentView *) self.view.superview
but didn't help.
It gives error while calling function for this object as
[UIVIew unrecognized selector......
If you're calling this directly from a
UIView
(and not aUIViewController
), it should beself.superview
instead ofself.view.superview
.