During the call to tableView:cellForRowAtIndexPath:
I'm calling this function to format a date into a time:
- (NSString *)_formatDate:(NSDate *)date withString:(NSString *)string {
NSLocale *locale = [NSLocale currentLocale];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
NSString *dateFormat = [NSDateFormatter dateFormatFromTemplate:string options:0 locale:locale];
[formatter setDateFormat:dateFormat];
[formatter setLocale:locale];
return [formatter stringFromDate:date];
}
I'm passing in the date for the row as well as the string @"HH:mm"
.
Unfortunately this seems to be lagging my table view. A similar thing is happening in my section headers where I am formatting to a full date.
Is there any reason this should be lagging my app so much? Are any of these calls particularly intensive?
Thanks
Tom