Reputation: 3771
I'm retrieving a string from an NSData object dataOut (coming from a CBCharacteristic), and defining a testString as well which is defined as the same value as shown below:
The problem is when I try to compare the two, I get that the two strings are not equal, even though the debugger shows otherwise:
Here is the comparison:
The log keeps logging "Strings are not equal!"
What am I doing wrong? Is the encoding incorrect, even though the strings are the same?
Upvotes: 1
Views: 123
Reputation: 46598
You will see them are different when you convert them to NSData
and print out the data.
What you see is not always what you get especially with Unicode characters. There maybe invisible characters or some characters that looks similar.
Upvotes: 3