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