dateWithString:calendarFormat:
文字列でカレンダー日付を作って返します
+(id)dateWithString:(NSString *)description: calendarFormat:(NSString *)format:
解説
文字列でカレンダー日付を作って返します。
フォーマットに合わなければnilを返します。
返り値
( id )
カレンダー日付/nil
引数
( NSString * )description
日付の文字列
( NSString * )format
フォーマット
フレームワーク
Foundation
クラス
NSCalendarDate
Class Methods
使用可能
10.0
参照
+ dateWithString:calendarFormat:locale:
- calendarFormat
- initWithString:calendarFormat:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSCalendarDate *theDate = [NSCalendarDate dateWithString:@"Sunday, 26 May 2002, 05:28 PM" calendarFormat:@"%A, %d %B %Y, %I:%M %p"]; NSLog([theDate description]); } @end