The problem you are having is due to isEqualToString:
performing a literal comparison, that is the sequence of bytes that make up the two strings must be exactly the same.
Your two strings look the same but are constructed differently, one uses the single Unicode code point for ARABIC LETTER ALEF WITH HAMZA BELOW, the other uses two code points ARABIC LETTER ALEF and ARABIC HAMZA BELOW to produce the same character - these two forms are called precomposed and decomposed respectively.
The standard string compare:
family of methods (compare:options:
, localizedCompare:
et al) default to considering composed characters, the forms which take an option can be set to behave like isEqualToString
by specifying NSLiteralSearch
.
So just change your code to:
ifEqual = [string1 compare:string2] == NSOrderedSame;
and you will get the answer you expect.