 <p>The problem with:</p> <pre><code>BOOL r = [res isEqualToString:@"\x124Vx\xc3\xaa"]; </code></pre> <p>is with the <code>\x124</code> part. It seems you can only have hex values in the range <code>00</code> - <code>ff</code>. And note the removal of the <code>[ ]</code> around the string.</p> <p>If you don't want the <code>4</code> to be considered part of the <code>\x</code> hex number, you can do this:</p> <pre><code>BOOL r = [res isEqualToString:@"\x12""4Vx\xc3\xaa"]; </code></pre> <p>The two double-quote characters ensure the <code>\x</code> escape sequence stops where you need it to.</p> <p>To eliminate the new warning about a possible missing comma when using such a string in an <code>NSArray</code>, you will need to use the older syntax to create the array:</p> <pre><code>NSArray *answers = [NSArray arrayWithObjects: @"", @"#", @"\x12""4Vx\xc3\xaa", nil ]; </code></pre>