-
Notifications
You must be signed in to change notification settings - Fork 0
Button in Code Objective C 1
Azmal Tech edited this page Dec 27, 2016
·
1 revision
// ViewController.h file
- import
@end //.............................................
/ // ViewController.m file
- import "ViewController.h"
@end
@implementation ViewController
- (void)viewDidLoad {
// add an action in current code file (i.e. target) [button addTarget: self action: @selector(buttonPressed:) forControlEvents: UIControlEventTouchUpInside];
}
- (void) buttonPressed: (UIButton *)button{
NSLog(@"the button has been pressed, Mr Azmal"); // it will preview after click button
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated.
}
@end