title: How to get number of current week in objective-c?
body: <p>I develop an app that needs to get the current week. I tried this:</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
      NSString *dateString = @"1-1-2011";
      NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
      [dateFormatter setDateFormat:@"dd-MM-yyyy"];
      NSDate *dateFromString = [[NSDate alloc] init];
      dateFromString = [dateFormatter dateFromString:dateString];
      NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
      NSDateComponents *comp = [gregorian components:NSWeekCalendarUnit fromDate:dateFromString];
      NSLog(@"%d", comp.week);
  
      [dateFormatter release];
  }
  </code></pre>
  
  <p>but it shows me 52. Which is actually a wrong result. Please, suggest me any ideas.
  Thanks in advance.</p>