I'm trying to pull NSDates from my plist, in order to create Datecomponents, but trying to do so give me problems.
This is some of the code I'm using:
self.Array = [NSMutableArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"matches" ofType:@"plist"]];
NSDateComponents *todayComp = [[NSCalendar currentCalendar] components:NSEraCalendarUnit|NSYearCalendarUnit|NSMonthCalendarUnit|NSDayCalendarUnit fromDate:[NSDate date]];
NSDateComponents *eventDateComp = [[NSCalendar currentCalendar] components:NSEraCalendarUnit|NSYearCalendarUnit|NSMonthCalendarUnit|NSDayCalendarUnit fromDate:[Array valueForKey:@"date"]];
I'm getting the todayComp's correctly, but the eventDateComp's, which I'm trying to get frm the plist, gives an error.
The plist is an array of dictionaries, like this:
<array>
<dict>
<key>date</key>
<date>2011-12-13T00:00:00Z</date>
<key>titel</key>
<string>Tilburg - Oss</string>
</dict>
<dict>
<key>date</key>
<date>2011-12-13T00:00:00Z</date>
<key>titel</key>
<string>Amsterdam - Roosendaal</string>
</dict>
</array>
NSLog says something like this...
-[__NSArrayI timeIntervalSinceReferenceDate]: unrecognized selector sent to instance 0x6a8d050
...which probably holds that I'm not getting the NSDates from the plist in the right way, but I have tried some different things, but have no clue how to do it right. Help is greatly appreciated.