ios - I am using this code to change a button title but it is not working. It just refreshes with the xib title -


this question has answer here:

 (ibaction)detailsongsbutton:(id)sender {      switch (songsortext) {         case 0:             _detailproducttext.text = _songlist;             _detailsongsbuttonlabel.titlelabel.text = @"album info."; //            nslog(@"_detaisongsbuttonlabel.titlelabel.text: %@",_detailsongsbuttonlabel.titlelabel.text);             songsortext = 1;             break;         case 1:             _detailproducttext.text = _producttext;             _detailsongsbuttonlabel.titlelabel.text = @"song list";             songsortext = 0;             break;         default:             break;     } } 

ensure setting button correct state, when selected may highlighted , change normal.

try setting title states such: [button settitle:@"title" forstate:uicontrolstatenormal|uicontrolstatehighlighted| uicontrolstatedisabled|uicontrolstateselected]


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -