I try to use the NSDate dateFromString method, but I get a warning and the application crashes. The code looks like this:
NSString *pickerDate = [NSString stringWithFormat:@"%@", timeSelector.date];
NSDate *defaultDate = [NSDate dateFromString:pickerDate];
Warning:
'NSDate' may not respond to '+dateFromString'.
It seems that the method is deprecated (at the height of the upgrade from Xcode 2 to 3.
What alternative method can I use to create a date from a string?
source
share