#import <UIKit/UIKit.h> @interface ViewController : UIViewController @property (weak, nonatomic) IBOutlet UILabel *label; @property (weak, nonatomic) IBOutlet UITextField *txt_name; -(IBAction)Submit_Command:(id)sender; @end
#import "ViewController.h" @implementation ViewController @synthesize label; -(IBAction)Submit_Command:(id)sender{ }
-(IBAction)Submit_Command:(id)sender{ label.text=txt_name.text; [txt_name resignFirstResponder]; }
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ [self.txt_name resignFirstResponder]; }