iphone - Disabling a button doesn't work -
i got button want disable when method getting called:
- (void)disablesendbutton { nslog(@"disablesendbutton method"); self.sendbtn.enabled = no; //[self.sendbtn setenabled:no]; }
header file property button: @property (strong, nonatomic) iboutlet uibutton *sendbtn;
, synthesize it.
disablesendbutton method
gets printed out button stays enabled... weird , don't know how can fix this. viewcontroller called sendviewcontroller , somewhere else in program [sendviewcontroller.sendbtn setenabled:no];
, works expected. other don't enable or disable button...
edit:
sendviewcontroller = [self.storyboard instantiateviewcontrollerwithidentifier:@"sendview"]; if(self.sendbuttonisenabled == no){ //sendviewcontroller.sendbtn.enabled = no; // doesn't work //[sendviewcontroller.sendbtn setenabled:no]; // doesn't work [sendviewcontroller disablesendbutton]; }
call method in viewdidload....
self.sendbtn.enabled = no;
Comments
Post a Comment