Permalink
Browse files

Added resetInitialSelectedDate.

  • Loading branch information...
1 parent f8da61c commit 310510b03ccad82283f642e8cd70cd901320b219 @PsychoH13 PsychoH13 committed Mar 28, 2012
Showing with 8 additions and 1 deletion.
  1. +1 −0 src/KalViewController.h
  2. +7 −1 src/KalViewController.m
View
@@ -37,6 +37,7 @@
- (void)reloadData; // If you change the KalDataSource after the KalViewController has already been displayed to the user, you must call this method in order for the view to reflect the new data.
- (void)showAndSelectDate:(NSDate *)date; // Updates the state of the calendar to display the specified date's month and selects the tile for that date.
- (NSDate *)selectedDate; // The currently selected date. You should only use the actual date components from this NSDate object. The hours/minutes/seconds/timezones are undefined.
+- (void)resetInitialSelectedDate;
@end
View
@@ -42,7 +42,7 @@ - (id)initWithSelectedDate:(NSDate *)selectedDate
{
if ((self = [super init])) {
logic = [[KalLogic alloc] initForDate:selectedDate];
- initialSelectedDate = [selectedDate retain];
+ initialSelectedDate = [selectedDate copy];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(significantTimeChangeOccurred) name:UIApplicationSignificantTimeChangeNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadData) name:KalDataSourceChangedNotification object:nil];
}
@@ -176,6 +176,12 @@ - (NSDate *)selectedDate
return [self.calendarView.selectedDate NSDate];
}
+- (void)resetInitialSelectedDate;
+{
+ [initialSelectedDate release];
+ initialSelectedDate = [[self selectedDate] copy];
+}
+
// -----------------------------------------------------------------------------------
#pragma mark UIViewController

0 comments on commit 310510b

Please sign in to comment.