I have an object, SCHRss
which has a NSDate
to be set in the header file. The code looks like this:
@property (nonatomic, strong) NSDate * time;
I want to create a SCHRss
object and set the NSDate
. At the moment the code looks like this:
SCHRss *rssObject = [[SCHRss alloc] init];
[rssObject setTitle:self.title];
[rssObject setLink:self.link];
[rssObject setImage:self.image];
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setTimeZone:[NSTimeZone systemTimeZone]];
[dateFormat setLocale:[NSLocale currentLocale]];
[dateFormat setDateFormat:@"EEEE, d MMMM yyyy h:mm:ss zzzz"];
[dateFormat setFormatterBehavior:NSDateFormatterBehaviorDefault];
[rssObject setTime:[dateFormat dateFromString:self.time]];
[self.feeds addObject:rssObject];
self.time
is returning the correct value. But when I called [rssObject time]
from the console, nil
is being returned. Any ideas?
For reference, the time stamp looks like this: Tue, 16 Jun 2015 06:41:58 +0000