You have set
[expressionDescription26 setExpressionResultType:NSInteger16AttributeType];
which causes the fetch request to return the date as an NSNumber
.
This number is the number of seconds since the "reference date" 1 January 2001, GMT),
so you could convert that to NSDate
with
NSNumber *sessDateAsNumber = [[objects26 objectAtIndex:0] valueForKey:@"swimLast750"];
NSDate *sessDate = [NSDate dateWithTimeIntervalSinceReferenceDate:[sessDateAsNumber doubleValue]];
But the better solution is probably to use
[expressionDescription26 setExpressionResultType:NSDateAttributeType];
in the expression description.
Then the date is returned as NSDate
object, and stringFromDate
works as expected.