macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

dateWithString:

文字列で日付時間をつくって返します
+(id)dateWithString:(NSString)aString:

解説

文字列で日付時間(NSDate)をつくって返します。
フォーマットは YYYY-MM DD HH:MM:SS±HHMM となります。

返り値

( id )

時間

引数

( NSString )aString

文字列

クラス

NSDate

Class Methods

使用可能

10.0

参照

- initWithString:

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
NSDate *theDate;
theDate = [NSDate dateWithString:@"2002-12-03 04:56:00 +0900"];                        
[myOutlet setStringValue:[theDate description]];
}

@end