title: iOS: Why does NSRange always throw error "use of undeclared identifier"?
body: <p>These lines of code are the problem:</p>
  
  <pre><code>case CostPeriodMonthly:
              NSRange days = [gregorian rangeOfUnit:NSDayCalendarUnit inUnit:NSMonthCalendarUnit forDate:[NSDate date]];
  
              [endDateComponents setDay:days.length];
              [endDateComponents setMonth:[todayComponents month]];
              [endDateComponents setYear:[todayComponents year]];
              break;
  </code></pre>
  
  <p>The first line using days is highlighted saying "Use of undeclared identifier days" but why? What do I miss here?</p>