NSFetchedResultsController titleForHeaderInSection with formatted NSDate

前端 未结 3 1566
一生所求
一生所求 2021-02-10 10:22

In my Core Data app I am using a FetchedResultsController. Usually to set titles for headers in a UITableView you would implement the following method like so:

-         


        
3条回答
  •  梦谈多话
    2021-02-10 10:38

    In iOS 4.0 and later, use the [NSDateFormatter localizedStringFromDate] class method and you won't have to worry about managing the NSDateFormatter instance. Otherwise this seems to be the only way to do it.

提交回复
热议问题