IBAction is not shown in IB?
i have done like
@interface tabViewController : UIViewController
{
IBOutlet UIButton* button_first;
IBOutle开发者_运维问答t UIButton* button_second;
IBOutlet UIButton* button_third;
IBOutlet UIButton* home;
}
but i could not in file owner those button? what i have to do? any help please? i have set everything correctly (viewcontroller, view)...the day before it was working...i tried in interface builder to reload classes etc...why it happens?
You should have this:
VC Header file:
@interface tabViewController : UIViewController
{
IBOutlet UIButton* button_first;
IBOutlet UIButton* button_second;
IBOutlet UIButton* button_third;
IBOutlet UIButton* home;
}
- (IBAction) ButtonMethod;
VC .m file:
- (IBAction) ButtonMethod
{
// Code goes here
}
You should now be able to link to the "ButtonMethod" in Interface Builder. Right click the button, click on the circle next to "Touch Up Inside" and link it to "ButtonMethod".
Hope that helps.
EDIT: This images doesn't show the blue line that appears when selecting but shows what you have to press:
Did you declare them as properties?
Using: in .h-fle
@property(nonatomic, retain) UIButton *button_first;
And in .m-file:
@synthesize button_first?
?
have a look at the nib file. may be you have changed the class of that nib file.
Check out whether you see tabViewController
in fornt of File's owner
.
I am sure you have changed the class so the change is not getting reflected of IBOUTLET in files owner.
and as told by @GUBB its not at all required to set hte property and synthesis of the stuffs..
hAPPY cODING...
精彩评论