2012년 1월 14일 토요일

iPhone - UIDatePicker setDate

NSCalendar * gregorian = [[[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar] autorelease];


NSDateComponents * components = [[[NSDateComponents alloc] init] autorelease];

[components setYear:2012];
[components setMonth:1];
[components setDay:1];
[components setHour:10];
[components setMinute:5];
[components setSecond:30];

[datePicker setDate:[gregorian dateFromComponents: components]];

댓글 없음:

댓글 쓰기