0

I have created a custom UIViewController with its view in a .xib file created in Interface Builder. The view looks like this:

enter image description here

The view has a UIButton with a target-action pair. The action is a method in the view's view controller. I want to add this view to a UIScrollView, so I created a simple custom view controller which just has as UIScrollView in it. I added the first view controller's view as a subview to the scrollview and set the content size properly.

Everything now works fine, except that when I press the button the application crashes and the 'EXC_BAD_ACCESS' warning comes up with error code 2.

How can I solve this?

1 Answers1

0

There is an action in your view controller that you assign to your button ?

Erhan
  • 908
  • 8
  • 19
  • Yes, I wired up the action method in Interface Builder. The target is the view controller. The pair works fine if I set the view on the picture as the root view controller. –  Apr 12 '14 at 10:50