How can i convert NSString to NSDate?
from these Strings:
NSString *year = @"2010";
NSString *month = @"3";
NSString *day = @"12";
to change UIDatePicker.Thanks
NSDateFormatter
can turn a string into a date. You create an NSDateFormatter
object, set its format using setDateFormat:
and then use its dateFromString:
method to convert a string into a date.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.