comparison of two strings fails

后端 未结 4 525
借酒劲吻你
借酒劲吻你 2020-12-21 14:16

I make a comparison of two strings which are obviously identical. Unfortunately my if clause doesn´t work as expected:

NSLog(@\"%@ == %@ ?\",strippedString1,         


        
4条回答
  •  被撕碎了的回忆
    2020-12-21 14:34

    You can't compare two NSStrings with the == operator, instead use

    [strippedString1 isEqualToString:strippedString2];
    

提交回复
热议问题