How to use stepper control in iphone?

Leave a Comment
Use stepper control in iphone to increment and decrements  values in iphone .here i will explain you complete code and i will also give you complete source code here.

header file
devangViewControlle.h

#import <UIKit/UIKit.h>
@interface devangViewController : UIViewController
@property (weak, nonatomic) IBOutlet UILabel *stepper_lbl;
- (IBAction)stepperchnaged:(id)sender;
@end
devangViewControlle.m


#import "devangViewController.h"
@interface devangViewController ()
@end
@implementation devangViewController
@synthesize stepper_lbl;
- (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)stepperchnaged:(id)sender {
    double value = [(UIStepper*)sender value];
 
    [stepper_lbl setText:[NSString stringWithFormat:@"%d", (int)value]];
}
@end

output:

 I hope you will be clear with this two files.

Download Source code

0 comments:

Post a Comment