I am facing some strange issue in my app.
in my ViewDidLoad() method I set title of my button as follows.
[btnA setTitle:@"A" forState:UIControlStateNormal];
On another click event I want to set the value of this title as nil as follows.
[btnA setTitle:nil forState:UIControlStateNormal];
but when I print the log immediately after above statement as follows
NSLog(@"btnA:%@",btnA.titleLabel.text);
It prints the log as follows
btnA:A
and strangely when I run app in simulator the text of button shows me nothing so it becomes nil on click event.
What is the problem any guess?
Try Following code
or in your own code try with delay