Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

parsedDate is nil on MagicalImportFunctions when changing iphone settings #700

Closed
aminebellakrid opened this Issue · 2 comments

2 participants

aminebellakrid Tony Arnold
aminebellakrid

I have in my model a Date field "startTime" and in the userInfo :

{"dateFormat":"yyyy'-'MM'-'dd'T'HH':'mm':'ssZZZZZ"} 

So this is working and the parsed time is the right one.

But if you go to your iphone's

settings > general > date&time > enable 24-Hour Time. 

then relaunch my app crashes because parsedDate is nil in :

// In MagicalImportFunctions.m 

NSDate * dateFromString(NSString *value, NSString *format)
{
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
    [formatter setLocale:[NSLocale currentLocale]];
    [formatter setDateFormat:format];

    NSDate *parsedDate = [formatter dateFromString:value];

    return parsedDate;
}

I am using 2.2 release .
I guess it's a date format issue but i don't know how to handle it. Any thought on this please @casademora @blackgold9 @tonyarnold ?

thanks

Tony Arnold
Owner

See how you go with the workaround in #627, otherwise have a look at the tests included with MagicalRecord. Let me know if your workaround works OK.

Tony Arnold tonyarnold closed this
aminebellakrid

:+1: Alright thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.