Last active
December 17, 2015 11:59
-
-
Save shoya140/5606750 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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