Reputation: 11633
I read this post but I don't really understand the code... I have a core data database with an Entity and some attributes. One of them is named "myDate" and has for type NSDate. Now I want to to display each date but eliminate dates with same day-month-year and display them ascendantly .
Have you got an idea?
Thanks a lot !
Upvotes: 0
Views: 1354
Reputation: 4729
If you are looking to have a UITableView with different sections for each date that has events sorted in acceding order then you can: (assuming your myDate attribute has the time as well)
myDate
making sure to comply with KVCmyDate
(you will need to use NSCalendar
and NSDateComponents
)[self setDateForSection:strippedDate];
to set the secondary dateNSFetchedResultsController
to use dateForSection
as the sectionNameKeyPath
UITableView
by myDate (there should be a method for this but I don't have any reference material in front of me right now, it might be in the NSFetchedResultsController
as well).Upvotes: 1