Skip to content

Instantly share code, notes, and snippets.

@shoya140
Last active December 17, 2015 11:59
Show Gist options
  • Save shoya140/5606750 to your computer and use it in GitHub Desktop.
Save shoya140/5606750 to your computer and use it in GitHub Desktop.
//
// ViewController.m
// CountSample
//
// Created by Shoya Ishimaru on 13/03/30.
// Copyright (c) 2013年 Shoya Ishimaru. All rights reserved.
//
#import "ViewController.h"
@interface ViewController (){
int counterNumber;
}
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
counterNumber = 0;
self.numberLabel.text = [NSString stringWithFormat:@"%d",counterNumber];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
}
- (IBAction)plusWasPushed:(id)sender {
counterNumber ++;
self.numberLabel.text = [NSString stringWithFormat:@"%d",counterNumber];
}
- (IBAction)clearWasPushed:(id)sender {
counterNumber = 0;
self.numberLabel.text = [NSString stringWithFormat:@"%d",counterNumber];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment