I am reading a RSS and from there an element:
<pubDate>
Thu, 07 Apr 2011 13:37:41 +0000</pubDate>
I use the following code to turn the received string into NSDate
NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
[dateFormatter setDateFormat:@"E, d LLL yyyy HH:mm:ss Z"]; // Thu, 18 Jun 2010 04:48:09 -0700
NSDate *date = [dateFormatter dateFromString:[self.currentDate stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]]];
[item setObject:date forKey:@"date"];
Code's working perfectly in simulator but on device it crashes. The reason is that NSDate object stays nil and when I'm adding it to the dictionary it crashes the app.
I read a lot around about this problem but none of the solutions worked for me. I mean lots of them did, but in simulator...
Any help appreciated, Luka ...