title: Compare two NSStrings
body: <p>In my app there is a mechanism that requires that at a certain point two <code>NSString</code>s will be the same to do something; for some reason when I compare the two, even when they are the same, it still doesn't recognize that. The code is something like this:</p>
  
  <pre><code>NSString * aString = [self someMethodThatGetsAString];
  
  NSString * bString;
  
  BOOL areStringsTheSame = NO;
  
  while (areStringsTheSame != YES) {
  
         bString = [self someMethodThatTakesNSStringsFromAnArrey];
         if (bString == aString) {
               areStringsTheSame = YES;
         { }
  </code></pre>
  
  <p>I even inserted an <code>NSLog()</code> and made sure that at a certain point they were the same (and as far as I know this is what <code>==</code> stands for...), but still it didn't get into the <code>if</code> to change the <code>BOOL</code> value.</p>
  
  <p>Is there another way to do this comparison? Am I missing something?</p>