Hi All,
Trying to compare a date (shown in a label, ''fed'' by an NSDate) and a string I've specified in order to disable a button. The label shows the date correctly and there are no fatal errors but the button is unaffected. Any thoughts? I know this may seem basic so I apologise; I've only been learning a couple of weeks in spare time from various tutorials - seems like a giant.
NSDate *B = [NSDate date];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; //NSDate from date
[dateFormatter setDateFormat:@"EEE"];
//Use label to check recept of Date
labelDate.text = [dateFormatter stringFromDate:[NSDate date]];
NSString *daytocompare = @"SAT";
labelShows.text =daytocompare;
if([daytocompare isEqualToString:labelDate.text]) {
buttontosatnoon.enabled=YES;
}
else{
buttontosatnoon.enabled= NO;
Any thoughts? Thank you!