initWithString:
文字列でカレンダー日付を作って初期化して返します
-(id)initWithString:(NSString *)description:
解説
文字列でカレンダー日付を作って初期化して返します。
文字列のフォーマットはYYYY-MM-dd HH:MM:SS +HHMMです。
返り値
( id )
カレンダー日付/nil
引数
( NSString * )description
日付を表す文字列
フレームワーク
Foundation
クラス
NSCalendarDate
Instance Methods
使用可能
10.0
参照
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSDate *theDate; theDate = [[NSCalendarDate alloc] initWithString:@"2001-01-01 00:00:00 +0900"]; NSLog([theDate description]); } @end