views:

240

answers:

1

Ok, this is really simple, maybe I'm a getting a bit burnt out, but seems like it should work, Query XML feed, put out date string, format, display in a cell. The issue is I'm a getting a NULL output. thanks for any help!

// 2009-06-03 11:30:00 example
NSDate *startValue = [[items objectAtIndex:indexPath.row] objectForKey:@"start"];
NSLog(@"DATE: %@",startValue);
// outputs 2009-06-03 11:30:00

NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyyMMddHHmmss"];
NSString *dateStr = [dateFormatter stringFromDate:startValue];
NSLog(@"DATE: %@", dateStr);
// outputs NULL
+3  A: 

Are you sure startValue is a date and not a string? Try examining its class.

Nicholas Riley
Well, it's in a date format, stored as a string. It looks like a date, smells like a date, is treated as a date. hmmmmmm That has to be the problem. Hacking it now.
ed potter