I was wondering how I could use NSDate within an if statement - I want to update a UILabel depending what the date is, currently I have the following code to determine the date but don't know how to actually get this within an if statement.
NSDate* date = [NSDate date];
NSDateFormatter* formatter = [[[NSDateFormatter alloc] init] autorelease];
[formatter setDateFormat:@"dd/MM/yyyy"];
NSString *dateString = [formatter stringFromDate:date];
dateLabel.text = dateString;
if (dateString == @"25/05/2012") {
NSLog(@"It's the 25th!");
}
else {
NSLog(@"Not it's not...");
}
Thanks a lot!