Created
October 13, 2011 04:47
-
-
Save tomohisa/1283407 to your computer and use it in GitHub Desktop.
test for synthesize
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 | |
// test | |
// | |
// Created by Tomohisa Takaoka on 10/12/11. | |
// Copyright (c) 2011 __MyCompanyName__. All rights reserved. | |
// | |
#import "ViewController.h" | |
@interface ViewController () | |
@property (nonatomic, assign) int testval; | |
@end | |
@implementation ViewController | |
{ | |
int _testval; | |
IBOutlet UILabel* label; | |
} | |
@synthesize testval; | |
- (void)didReceiveMemoryWarning | |
{ | |
[super didReceiveMemoryWarning]; | |
// Release any cached data, images, etc that aren't in use. | |
} | |
#pragma mark - View lifecycle | |
- (void)viewDidLoad | |
{ | |
_testval = 2; | |
self.testval = 1; | |
[super viewDidLoad]; | |
// Do any additional setup after loading the view, typically from a nib. | |
} | |
- (void)viewDidUnload | |
{ | |
[super viewDidUnload]; | |
// Release any retained subviews of the main view. | |
// e.g. self.myOutlet = nil; | |
} | |
- (void)viewWillAppear:(BOOL)animated | |
{ | |
label.text = [NSString stringWithFormat:@"%d",_testval]; | |
[super viewWillAppear:animated]; | |
} | |
- (void)viewDidAppear:(BOOL)animated | |
{ | |
[super viewDidAppear:animated]; | |
} | |
- (void)viewWillDisappear:(BOOL)animated | |
{ | |
[super viewWillDisappear:animated]; | |
} | |
- (void)viewDidDisappear:(BOOL)animated | |
{ | |
[super viewDidDisappear:animated]; | |
} | |
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation | |
{ | |
// Return YES for supported orientations | |
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment