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?
-(void)clicketbutton {
UIButton *mybutton = [UIButton buttonWithType:UIButtonTypeCustom];
[mybutton setTitle:@"Click here" forState:UIControlStateNormal];
[mybutton addTarget:self
action:@selector(displayvalue:)forControlEvents:UIControlEventTouchUpInside];
}
-(void)displayvalue:(id)sender {
NSLog(@"The title is %@ ", [mybutton titleForState:UIControlStateNormal]);
}