#import <UIKit/UIKit.h>

@interface ViewController : UIViewController  <UITextFieldDelegate>{
    
    UIButton *m_UIButton01;
    UITextField *m_UITextField01;
    UITextField *m_UITextField02;
}
@property(nonatomic,retain) IBOutlet UIButton *m_UIButton01;
@property(nonatomic,retain) IBOutlet UITextField *m_UITextField01;
@property(nonatomic,retain) IBOutlet UITextField *m_UITextField02;


-(IBAction) Event1:(id)sender;

-(IBAction) Event2:(id)sender;

@end

//
//  ViewController.m
//  myfirstApp
//
//  Created by powen ko on 5/17/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "ViewController.h"

@implementation ViewController

@synthesize   m_UIButton01,m_UITextField01,m_UITextField02;




#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    [m_UITextField01 setText:@"40"];
    [m_UITextField02 setText:@"50"];
    
    m_UITextField01.delegate=self;
    m_UITextField02.delegate=self;
   
}



-(IBAction) Event1:(id)sender{
    NSString* t_string1=[m_UITextField01 text];
    
    
    
    [m_UITextField02 setText:@"100"];
  //  [m_UIButton01 setTitle:@"abc" forState:UIStatus
    
}

-(IBAction) Event2:(id)sender{
    
    [m_UITextField01 resignFirstResponder];
    [m_UITextField02 resignFirstResponder];
    
}




- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [m_UITextField01 resignFirstResponder];
    [m_UITextField02 resignFirstResponder];
}
@end

By admin-powenko

Dr. Powen Ko is a teacher and CEO on LoopTek LLC, and like to teaching. if you need to class, please let PowenKo know, he will love to service and sharing. LoopTek web site is www.looptek.com

Leave a Reply