ios - Hide/Show & Enable/Disable a button ? -
i'm quite new @ ios development , i'm facing trouble hiding/showing button in gui. because need buttons appear or disappear , enabled or disabled. followed great tutorials on net can not figure out going wrong code.
here viewcontroller.h :
/ // viewcontroller.h // weddingvideobooth // // created frédéric mouza on 15/07/13. // copyright (c) 2013 frédéric mouza. rights reserved. // #import <uikit/uikit.h> @interface viewcontroller : uiviewcontroller{ iboutlet uibutton *but_record; } @property (nonatomic,retain) iboutlet uibutton *but_record; - (ibaction)but_record:(uibutton *)sender; @end and .m file :
// // viewcontroller.m // weddingvideobooth // // created frédéric mouza on 15/07/13. // copyright (c) 2013 frédéric mouza. rights reserved. // #import "viewcontroller.h" #import "mobilecoreservices/utcoretypes.h" @interface viewcontroller () @end @implementation viewcontroller @synthesize but_record; - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. but_record.hidden=yes; } - (void)didreceivememorywarning { [super didreceivememorywarning]; // dispose of resources can recreated. } - (ibaction)but_record:(uibutton *)sender { but_record.enabled=no; } @end it's simple and, understand, button disable when click on it... currently, button remains same when click on it. tried hide using property "but_record.hidden=yes" nothing worked.
does have idea, please ?
thanks again
add nslog() but_record see if ibaction getting called. sounds not triggering didn't link them in interface builder. , mentioned above take out hidden=yes
Comments
Post a Comment