iOS if else statement not working [closed]

if ((dateString = asd)) 

Here you are assigning asd to dateString, as you use a single =.
Comparisons are made with ==.

But as NSString instances are pointers, you can’t use == to compare the string values.
Use:

if( [ str1 isEqualToString: str2 ] )

That being said, I think you should really take some time to learn some Objective-C basics…

Browse More Popular Posts

Leave a Comment