Created
November 13, 2013 08:29
-
-
Save siman-man/7445612 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 | |
// NSUserDefault | |
// | |
// Created by siman on 2013/11/13. | |
// Copyright (c) 2013年 siman. All rights reserved. | |
// | |
#import "ValueViewController.h" | |
#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)returnValueInput:(id)sender { | |
_value = self.valueInput.text; | |
NSLog(@"%@", _value); | |
} | |
- (IBAction)readInputValue:(id)sender { | |
NSLog(@"Read defualt value =>"); | |
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; | |
NSString *str = [ud stringForKey:@"VALUE"]; | |
_userDefaultValue.text = str; | |
NSLog(@"%d", _selectedValue.selectedSegmentIndex); | |
} | |
- (IBAction)clearInputValue:(id)sender { | |
_userDefaultValue.text = @""; | |
} | |
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender | |
{ | |
ValueViewController *viewController = [[ValueViewController alloc] initWithNibName:@"kekka" bundle:nil]; | |
[ viewController changeValue:_value ]; | |
NSLog(@"%@", [segue identifier]); | |
NSLog(@"%@", _value); | |
//Segueの特定 | |
if ( [[segue identifier] isEqualToString:@"next"] ) { | |
ValueViewController *valueViewController = [segue destinationViewController]; | |
valueViewController.sample_value = _value; | |
} | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment