title: getting work days of week
body: <p>I am working on a student schedule and i have a problem. I need to have an array of days of current week, and of next week. So if today is Tue 11.11 i need to somehow get Mon 10.11 Tue 11.11 Wed 12.11 Thurs 13.11 Friday 14.11, and the same days of the next week with it dates. This one i need to do in my program such function, when user can pick any day of week and set his schedule on this day. I looked everywhere on stack overflow, but all solutions was not exact. Can you help me? Here is some of my attempts. </p>
  
  <pre><code>NSDate *now = [NSDate date];
  
  NSCalendar *calendar = [NSCalendar currentCalendar];
  
  NSDate *beginningOfThisWeek;
  NSDate *beginningOfNextWeek;
  
  NSTimeInterval durationOfWeek;
  [calendar setFirstWeekday:3];
  [calendar rangeOfUnit:NSCalendarUnitWeekOfMonth
              startDate:&amp;beginningOfThisWeek
               interval:&amp;durationOfWeek
                forDate:now];
  
  beginningOfNextWeek = [beginningOfThisWeek dateByAddingTimeInterval:durationOfWeek];
  
  
  NSDate *date = beginningOfThisWeek;
  NSMutableArray *dateArray = [@[] mutableCopy];
  
  while (![beginningOfNextWeek compare:date]  == NSOrderedSame) {
      [dateArray addObject:date];
      NSDateComponents *comps = [calendar components:NSUIntegerMax fromDate:date];
      comps.day +=1;
      date = [calendar dateFromComponents:comps];
  
  }
  NSLog(@"%@",dateArray);
  NSLog(@"%@",now);
  </code></pre>
  
  <p>but in log i get something like:</p>
  
  <pre>
  2014-11-11 18:37:29.479 StudentSchedule[3964:436389] (
      "2014-11-10 22:00:00 +0000",
      "2014-11-11 22:00:00 +0000",
      "2014-11-12 22:00:00 +0000",
      "2014-11-13 22:00:00 +0000",
      "2014-11-14 22:00:00 +0000",
      "2014-11-15 22:00:00 +0000",
      "2014-11-16 22:00:00 +0000"
  </pre>
  
  <p>i have dates, but 7, and i don't have names of weekdays, which is very important. I know that my question is very simple, but i am tired of looking for the right answer.</p>