0
votes

i have date attribute in core data entity. i have count and groupy by date (yyyy-mm-dd).

NSFetchRequest can have an array of attributes for grouping. [fetchRequest setPropertiesToGroupBy:arrayObject]

i'm going to group on multiple attributes. grouping using the function works. but i want to group it by year month and day.

nsfetchresultcontroller can only do sectioning on ONE attribute. which i dont need.

anyone have idea how to goup using NSFetchRequestonly on day month and year (utc to localTimezone)?

1

1 Answers

0
votes

i had to sort fetch result controller on date time(UTC) first, then i had to calculate date only from date time field (UTC) on the fly. and then manually iterate through the fetched objects and group them. so the table view is not using fetch result controller. i dont like the solution but i couldnt get fetch result controller to convert date from UTC then group it. anyway it works fine with manual solution.