문제

How do I have a textfield with on viewdidLoad load with today's date? i think it requires nsdateformatter but i don't know how to do it if somebody could provide some code. Thank you.

도움이 되었습니까?

해결책

You can try this

NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"YYYY-MM-dd"];
NSDate *todaysDate = [NSDate date];
NSLog(@"Todays date is %@",[formatter stringFromDate:todaysDate]);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top