Im new to obj-c and need some help with this code
NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
[dateFormatter setDateFormat:@"E, d LLL yyyy HH:mm:ss Z"];
NSDate *date = [dateFormatter dateFromString:currentDate];
the variable date cannot be nil. how can I make it so that date = current time when it's unable to format the string? can i use try/catch? how?