This file contains hidden or 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
//now に グリニッジ標準時間が格納される | |
NSDate* now = [NSDate date]; | |
//now に 日本時間で格納される | |
NSDate* now = [NSDate dateWithTimeIntervalSinceNow:[[NSTimeZone systemTimeZone] secondsFromGMT]]; | |
This file contains hidden or 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
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
// Do any additional setup after loading the view, typically from a nib. | |
// Get the main bundle for the app. | |
NSBundle* mainBundle; | |
mainBundle = [NSBundle mainBundle]; | |
NSString* myImage = [mainBundle pathForResource:@"backgraund02_03" ofType:@"png"]; | |
This file contains hidden or 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
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
// Do any additional setup after loading the view, typically from a nib. | |
// Get the main bundle for the app. | |
NSBundle* mainBundle; | |
mainBundle = [NSBundle mainBundle]; | |
// Create folder references で追加したファイルは | |
// パスを指定しないとエラーになる。 |
This file contains hidden or 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
test |
This file contains hidden or 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
#pragma mark - Picker View | |
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)timerPicker | |
{ | |
return 2; | |
} |
This file contains hidden or 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
#import <UIKit/UIKit.h> | |
#import "KitchenTimerViewController.h" | |
@interface SettingViewController : UIViewController | |
@property (weak, nonatomic) IBOutlet UIPickerView *timerPicker; | |
@property int intPickerMin; | |
@property int intPickerSec; |
This file contains hidden or 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
- (NSInteger)pickerView:(UIPickerView *)timerPicker numberOfRowsInComponent:(NSInteger)component | |
{ | |
if (component == 0) { | |
return 60; | |
} else if (component == 1) { | |
return 60; | |
} else { | |
return 0; | |
} | |
} |
This file contains hidden or 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
- (NSString *)pickerView:(UIPickerView *)timerPicker titleForRow:(NSInteger)row | |
forComponent:(NSInteger)component; | |
{ | |
if (component == 0) { | |
NSString *strMinute[] = {@"00", @"01", @"02", @"03", @"04", @"05", @"06", @"07", @"08", @"09" | |
, @"10", @"11", @"12", @"13", @"14", @"15", @"16", @"17", @"18", @"19" | |
, @"20", @"21", @"22", @"23", @"24", @"25", @"26", @"27", @"28", @"29" | |
, @"30", @"31", @"32", @"33", @"34", @"35", @"36", @"37", @"38", @"39" | |
, @"40", @"41", @"42", @"43", @"44", @"45", @"46", @"47", @"48", @"49" | |
, @"50", @"51", @"52", @"53", @"54", @"55", @"56", @"57", @"58", @"59" |
This file contains hidden or 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
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component | |
{ | |
self.intPickerMin = (int)[self.timerPicker selectedRowInComponent:0]; | |
self.intPickerSec = (int)[self.timerPicker selectedRowInComponent:1]; | |
} |
This file contains hidden or 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
- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { | |
if ([[segue identifier] isEqualToString:@"toKitchenTimer"]) { | |
KitchenTimerViewController *kitchenTimer = [segue destinationViewController]; | |
kitchenTimer.intPickerMin = self.intPickerMin; | |
kitchenTimer.intPickerSec = self.intPickerSec; | |
} | |
} |
OlderNewer