title: Comparing two NSNumber objects
body: <p>I used this code to compare two NSNumber objects, but it never passed the if condition.</p>
  
  <pre><code>listItems = [appDelegate.productStatus componentsSeparatedByString:@","];
  
  
  for (int i=0;i&lt;[appDelegate.productArray count]; i++)
  {
  
      for (int j=0; j&lt;[listItems count]; j++) 
      {
          number=[NSNumber numberWithInt:[[listItems objectAtIndex:j] intValue]];
          NSLog(@"number %@",number);
          productObject=[appDelegate.productArray objectAtIndex:i];           
          NSLog(@"%@,%@",productObject.pid,number);
          if (productObject.pid == number) 
          {
              NSLog(@"BUY it!!!");
              [purchasArray addObject:productObject];
          }
  
      }
  }
  </code></pre>
  
  <p>What is wrong?</p>