I create a button and set title as \"Click here\". When I press that button I want to get that button title and log it. Here\'s my code, where am I going wrong?
Your displayvalue: method should look something like this:
-(void)displayvalue:(id)sender { UIButton *resultButton = (UIButton *)sender; NSLog(@" The button's title is %@.", resultButton.currentTitle); }
(Please check out the documentation in XCode, it would have given you the right answer.)