Monday, 23 July 2012

# UIStepper

------------------------------------------------------------------------------
  • ViewController.h
------------------------------------------------------------------------------
#import <UIKit/UIKit.h>

@interface ViewController : UIViewController {
    IBOutlet UITextField *i;
}

@property (nonatomic, retain) UITextField *i;

-(IBAction)valueChange:(id)sender;

@end
------------------------------------------------------------------------------
  • ViewController.m
------------------------------------------------------------------------------
#import "ViewController.h"

@implementation ViewController

@synthesize i;

-(IBAction)valueChange:(UIStepper *)sender {
 
    double value = [sender value];
 
    [i setText : [NSString stringWithFormat:@"%f",value]];
 
}
------------------------------------------------------------------------------

  • ViewController.xib
------------------------------------------------------------------------------




------------------------------------------------------------------------------

  • Output
------------------------------------------------------------------------------



No comments:

Post a Comment