Subview access to superview

user1410595 picture user1410595 · May 23, 2012 · Viewed 8.6k times · Source

I have a scrollView with its content view and finally a subview on the content view. I would like to stop scrolling [scrollView scrollEnabled:NO] from the subview. Can I get at the method?

Answer

Jon Friskics picture Jon Friskics · May 23, 2012

I don't have Xcode in front of me, but can't you get at the superview with self.superview from your subview code?

For instance, like so:

[subview.superview scrollEnabled:NO];