UIButton Much needed IBOutlet?
I created a ViewController and it has 6 UIButtons.Each one has different tasks . Its work fine.
When i am creating one button (sample)
IBOutlet UIButton *loginnextbtn;
@property(nonatomic,retain) UIButton *loginnextbtn;
@synthesize loginnextbtn;
[loginnextbtn release];
-(IBAction)LoginNextBtnPressed:(id)sender;
then i delete these all IBOutlet ,property,synthesize,release . I only added
-(IBAction)LoginNextBtnPressed:(i开发者_如何学Cd)sender;
Its work fine.My doubt is why we need to iboutlet for button.And also one important think is I dont change button title or image at anytime.I just use these buttons only for button click event .For this case can i use IBAction only ? Is there any problem occurs in my project while its running ..plz help me..
sorry for my bad english..
hey dragon there wont be any problem if u just use the IBAction for binding ur method with the button... If you are not changing the title or color of the button at run time then you dont need to take it as iboutlet... Just bind the button you took with the action you want to set for that particular button's click event...
Happy coding
精彩评论