how to find last day of current week in iphone?
<p>In my application I m using following codes to retrieve current date and day :-</p>

<p>NSDate *today1 = [NSDate date];
    NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
    [dateFormat setDateFormat:@"dd/MM/yyyy :EEEE"];
    NSString *dateString11 = [dateFormat stringFromDate:today1];</p>

<pre><code>NSLog(@"date: %@", dateString11);
//[dateFormat release];
NSCalendar *gregorian11 = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];  
NSDateComponents *components1 = [gregorian11 components:NSWeekdayCalendarUnit | NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit fromDate:today1];
[components1 setDay:([components1 day]-([components1 weekday]-1))];

NSDate *beginningOfWeek1 = [gregorian11 dateFromComponents:components1];
NSDateFormatter *dateFormat_first = [[NSDateFormatter alloc] init];
[dateFormat_first setDateFormat:@"dd/MM/yyyy :EEEE"];
NSString *dateString_first = [dateFormat_first stringFromDate:beginningOfWeek1];

NSLog(@"First_date: %@", dateString_first);
</code></pre>

<p>but using above code I only got the current day and Date and first day of week but I need to get last day of week.</p>

<p>Where I m wrong in my code and what modification is needed to get last day/date of week.</p>

<p>Please help me out its urgent.</p>

<p>Thanks a lot in advance</p>
