Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // ViewController.m
- // Counter
- //
- // Created by Сергей on 23.03.17.
- // Copyright © 2017 School. 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)increment:(id)sender{
- Ftotal++;
- Ptotal++;
- Count++;
- [screen setText:[NSString stringWithFormat:@"%ld", Ftotal]];
- [display setText:[NSString stringWithFormat:@"%ld", Ptotal]];
- }
- -(IBAction)count:(id)sender{
- Ftotal += Count;
- Ptotal += Count;
- //Count++;
- [screen setText:[NSString stringWithFormat:@"%ld", Ftotal]];
- [display setText:[NSString stringWithFormat:@"%ld", Ptotal]];
- }
- -(IBAction)decrement:(id)sender{
- Ptotal = 0;
- Count = 0;
- [screen setText:[NSString stringWithFormat:@"%ld", Ftotal]];
- [display setText:[NSString stringWithFormat:@"%ld", Ptotal]];
- }
- -(IBAction)clear:(id)sender{
- Ftotal = 0;
- Ptotal = 0;
- Count = 0;
- [screen setText:[NSString stringWithFormat:@"%ld", Ftotal]];
- [display setText:[NSString stringWithFormat:@"%ld", Ptotal]];
- }
- @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement