//
// ViewController.h
// stepperApp
//
// Created by Weerachai on 11/10/55 BE.
// Copyright (c) 2555 Weerachai. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
{
IBOutlet UILabel *lblResult;
}
- (IBAction)stepperChanged:(id)sender;
@end
ViewController.m
//
// ViewController.m
// stepperApp
//
// Created by Weerachai on 11/10/55 BE.
// Copyright (c) 2555 Weerachai. All rights reserved.
//
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)stepperChanged:(id)sender {
UIStepper *stepper = (UIStepper *)sender;
double value = [stepper value];
[lblResult setText:[NSString stringWithFormat:@"%d", (int)value]];
}
- (void)dealloc {
[lblResult release];
[super dealloc];
}
@end