I need find the weeks list between 2 dates. I have startdate and enddate and the startdate might be any day(eg.Tuesday or Friday) for that start week, and the end date also the same like any day for the end week. how do i find the weeks list.please help me to do this.
Share
Use NSDateComponents against the current calendar specifying the fromDate and toDate and a components flag os NSWeekCalendarUnit. Then the week property of the returned NSDateComponents object will be the number of weeks between the two dates, e.g.:
where ‘firstDate’ and ‘secondDate’ are NSDate objects.