title: Compare 2 strings in objective-C
body: <p>I wrote the following code:</p>
  
  <pre><code>   if (depSelectedIndice &gt; -1 &amp;&amp; comSelectedIndice&gt; -1)
          {
              NSLog(@"depart elemet : %d ",depSelectedIndice);
              NSLog(@"depart elemet : %d ",comSelectedIndice);
              NSLog(@"ok1");
              NSString *choosedDate =[NSString stringWithFormat:@"%@%@",[deparatureDates objectAtIndex:depSelecif (depSelectedIndice &gt; -1 &amp;&amp; comSelectedIndice&gt; -1)
      {
          NSLog(@"depart elemet : %d ",depSelectedIndice);
          NSLog(@"depart elemet : %d ",comSelectedIndice);
          NSLog(@"ok1");
          NSString *choosedDate =[NSString stringWithFormat:@"%@%@",[deparatureDates objectAtIndex:depSelectedIndice], [goingBackDates objectAtIndex:comSelectedIndice]];
          NSLog(@"0000000000001");
  
          NSLog(@" number of element : %d", [allCombinations count]);
  //        for (int j=0; j&lt;[allCombinations count]; j++)
  //        {
  //            NSLog(@"111111111111111111");
  //           // NSString *date = [[allCombinations objectAtIndex:j] objectForKey:@"keydate"];
  //            NSLog(@"22222222222222222222");
  //              if([date isEqualToString:choosedDate])
  //              {
  //                  depPrice.text=@"1";
  //                  comPrice.text=@"1";
  //                  price.text=@"3";
  //                  
  //              }
         // }
      }
  </code></pre>
  
  <p>allCombinations is an <code>NSArray</code> declared in .h, I have initilase and used it in another method. I can't use in in this method? :/</p>
  
  <p>But I have a crash. I don't really know where the problem is but I think it's when I compare <code>if(date==choosedDate)</code>? Help please</p>