Passing button title to a new view
问题 I have a button on a view which when pressed opens another second view. I want to set a label in the second view to change depending on the label of the button that was pressed. I have tried passing (id) sender in my switchViews function but that does not work. Please help! 回答1: On your second view controller, create a the UILabel as a property i.e. @interface MyViewcontroller : UIViewController { UILabel *titleLabel; } @property (nonatomic, retain) IBOutlet UILabel *titleLabel; and, in