Advertisement
Guest User

Untitled

a guest
Oct 20th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. - (void)setDate:(NSDate *)date {
  2. _date = date;
  3. if (date) {
  4. NSDateComponents *comps = [self.calendar components:NSDayCalendarUnit|NSMonthCalendarUnit fromDate:date];
  5. [self setTitle:[NSString stringWithFormat:@"%d", comps.day] forState:UIControlStateNormal];
  6. } else {
  7. [self setTitle:@"" forState:UIControlStateNormal];
  8. NSString *myDateObj=@"2014-10-20";
  9. if([myDateObj
  10. compare:self.date]==NSOrderedSame)
  11.  
  12. {
  13.  
  14. _dateItem.backgroundColor=[UIColor greenColor];
  15. }
  16. else{
  17. NSLog(@"NO MATCH");
  18. }
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement