If “a == b” is false when comparing two NSString objects

前端 未结 5 1642
梦毁少年i
梦毁少年i 2020-11-27 23:21

I have a class with an accessible method that passes back an NSString when called.

[MyClass getMyString]

The string variable

5条回答
  •  失恋的感觉
    2020-11-28 00:00

    you can not use '==' to compare two NSString

    you should to use [NSString isEqualToString:(NSString*)] to compare two string

提交回复
热议问题