我有两个字符串。这个字符串不相等,但 if else 语句总是说是。
我的代码这些;
PFQuery *bilquery = [PFQuery queryWithClassName:@"Bildirim"];
PFObject *saat = [bilquery getObjectWithId:@"lQTsXaBvuq"];
NSString *asd = [saat objectForKey:@"gun"]; //asd is 06 or 07.
NSDate *currDate = [NSDate date];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
[dateFormatter setDateFormat:@"dd"];
NSString *dateString = [dateFormatter stringFromDate:currDate];
int d = [dateString intValue] + 1;
NSString *dplus1 = [NSString stringWithFormat:@"%d",d];
if ((dateString = asd)) {
NSLog(@"YES");
} else {
NSLog(@"NO");
// Bla bla bla
}
NSString asd 在我的解析数据库中。if else 语句中我的正确之处在哪里?