Skip to content

Instantly share code, notes, and snippets.

@muhku
Created May 17, 2010 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muhku/404219 to your computer and use it in GitHub Desktop.
Save muhku/404219 to your computer and use it in GitHub Desktop.
diff --git a/src/TapkuLibrary/TKCalendarMonthView.m b/src/TapkuLibrary/TKCalendarMonthView.m
index 0de7bc8..174a5bc 100644
--- a/src/TapkuLibrary/TKCalendarMonthView.m
+++ b/src/TapkuLibrary/TKCalendarMonthView.m
@@ -812,6 +812,11 @@
dayView.frame = CGRectMake((i - 1) * 46 - 1, 0, 47, 45);
[dayView setString:[NSString stringWithFormat:@"%d",lead] selected:NO active:NO today:NO marked:NO];
+ // Because the day views are cached, remove a previous tag from
+ // the day view (if there happens to be such). Otherwise the day
+ // view might be accidentally marked.
+ dayView.tag = 0;
+
[self addSubview:dayView];
[dayTiles addObject:dayView];
@@ -869,6 +874,11 @@
dayView.frame = CGRectMake((i - 1) * 46 - 1, line * 44, 47, 45);
[dayView setString:[NSString stringWithFormat:@"%d",counter] selected:NO active:NO today:NO marked:NO];
+ // Because the day views are cached, remove a previous tag from
+ // the day view (if there happens to be such). Otherwise the day
+ // view might be accidentally marked.
+ dayView.tag = 0;
+
[self addSubview:dayView];
[dayTiles addObject:dayView];
[dayView release];
@@ -1111,4 +1121,4 @@
}
-@end
\ No newline at end of file
+@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment