initWithTimeInterval:sinceDate:
指定日付時間より指定秒数分進んだ(遅れた)日付時間を初期化して返します
-(id)initWithTimeInterval:(NSTimeInterval)seconds: sinceDate:(NSDate *)anotherDate:
解説
指定日付時間より指定秒数分進んだ(遅れた)日付時間を初期化して返します。
【NSTimeInterval】
● 秒数をdouble数値で指定します。
返り値
( id )
時間
引数
( NSTimeInterval )seconds
時間間隔(秒)
( NSDate * )anotherDate
別の時間
フレームワーク
Foundation
クラス
NSDate
Instance Methods
使用可能
10.0
参照
-initWithTimeIntervalSinceReferenceDate:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSDate *baseDate = [[NSDate alloc] initWithString:@"2002-12-03 04:56:00 +0900"]; NSDate *theDate = [[NSDate alloc] initWithTimeInterval:3600 sinceDate:baseDate]; [myOutlet setStringValue:[theDate description]]; } @end