NSString *title=btn.titleLabel.text;
NSLog(@"Title=%@",title);
if(title == @"SelectCategory")
{
//alert
}
else
{
//somecode
}
I want to check title of UIButton. But my code always executing else statement.
What is the error in this code?
Never compare two strings using ‘==’, use isEqualToString