title: How to get days in a week from today in objective c
body: <p>I am trying to get the days of a week in reference to their date.
  Ex.: 14th October is a Wednesday.
  I am creating a collection view cell and displaying the date as follows.
  <a href="https://i.stack.imgur.com/61UOt.png" rel="noreferrer"><img src="https://i.stack.imgur.com/61UOt.png" alt="enter image description here"></a></p>
  
  <p>In the 14th cell it would display Wednesday, but how to get the next day as Thursday, then Friday...and so on.</p>
  
  <p>I have got todays date and which day it is as follows,</p>
  
  <pre><code>day = [components day];
  week = [components month];
  year = [components year];
  weekday = [components weekday];
  NSString *string = [NSString stringWithFormat:@"%ld.%ld.%ld", (long)day, (long)week, (long)year];
  NSLog(@"%@",string);
  NSDate *todayDate = [NSDate date]; // get today date
  NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
  [dateFormatter setDateFormat:@"EEEE"];
  NSString *convertedDateString = [dateFormatter stringFromDate:todayDate];// here convert date in
  NSLog(@"Today formatted date is %@",convertedDateString);
  </code></pre>
  
  <p>And i have found this method online, which returns the days in string when you pass the integer, but i am having trouble in this too, not understanding which integer to pass every time so I get different strings.</p>
  
  <pre><code>static inline NSString *stringFromWeekday(int weekday){
  static NSString *strings[] = {
      @"Sunday",
      @"Monday",
      @"Tuesday",
      @"Wednesday",
      @"Thursday",
      @"Friday",
      @"Saturday",
  };
  
  return strings[weekday];
  </code></pre>
  
  <p>}</p>