Let's look at the exception:
-[UIViewController setHappiness:]: unrecognized selector sent to instance
This tells you two things about an unrecognized message. It tells you the selector, setHappiness: It also tells you the actual, executable class of the receiver, UIViewController .
Of course, the UIViewController does not have a method called setHappiness: This is why you got the exception.
You wrote a subclass of UIViewController called HappinessViewController , which has a setHappiness: method (or a read / write property called happiness , which the method generates). And you want the receiver (destination view controller) to be an instance of this subclass ( HappinessViewController ).
But the exception tells you that the destination view controller is just a UIViewController . Therefore, even if you think that this is so, you probably did not specify a custom view controller class in the storyboard. You may have configured your own class for some other view controller, but you have not defined the class for this destination.
You need to set a custom destination controller class in the Identity Inspector, for example:

rob mayoff
source share