Question

I have an application where I am creating and adding PrimaryViewController to a UIScrollView, when the user taps on a button on PrimaryViewController's view, I create and add a SecondViewController to the UIScrollView. The SecondViewController creates and adds a new UIScrollView to it's view.

My problem is this: I need to get a tap event on the SecondViewController's UIScrollView. But when I tap on the SecondViewController's UIScrollView it throws an error (unrecognized selector). I believe it has to do with the view hierarchy and the fact that I am creating a new SecondViewController each time the button on PrimaryViewController's view is tapped (which I need to do). Does anyone know how to solve this view-hierarchy issue? If you need more of an explanation let me know.

Was it helpful?

Solution

A friend helped me solve my issue. I was creating a new SecondViewController each time the PrimaryViewController's button was tapped. I changed it so I just update the data in the SecondViewController instead of creating an entirely new view controller. I still don't quite understand the problem, but will update this post if I figure out why.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top