How can we get date of a specific day in current week with day name (Between monday and sunday)? e.g. I want to learn what is the date of this sunday or what was the date of last monday.
EDIT: Here how I solved the problem with the help of @juniperi 's link
//To get current day
CFAbsoluteTime at = CFAbsoluteTimeGetCurrent();
CFTimeZoneRef tz = CFTimeZoneCopySystem();
SInt32 currentWeekdayNumber = CFAbsoluteTimeGetDayOfWeek(at, tz);
//We are adding or substracting from the day we want and add to the current date
NSDate *now = [NSDate date];
int daysToAdd = theDayNumberWeWant - currentWeekdayNumber;
NSDate *newDate1 = [now dateByAddingTimeInterval:60*60*24*daysToAdd];