Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)setDate:(NSDate *)date {
- _date = date;
- if (date) {
- NSDateComponents *comps = [self.calendar components:NSDayCalendarUnit|NSMonthCalendarUnit fromDate:date];
- [self setTitle:[NSString stringWithFormat:@"%d", comps.day] forState:UIControlStateNormal];
- } else {
- [self setTitle:@"" forState:UIControlStateNormal];
- NSString *myDateObj=@"2014-10-20";
- if([myDateObj
- compare:self.date]==NSOrderedSame)
- {
- _dateItem.backgroundColor=[UIColor greenColor];
- }
- else{
- NSLog(@"NO MATCH");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement