title: Checking for equality in Objective-C
body: <p>How do i check the key in dictionary is same as the string in method parameter?
  i.e in below code , dictobj is NSMutableDictionary's object , and for each key in dictobj i need to compare with string. How to achieve this ? Should i typecase key to NSString??</p>
  
  <pre><code>-(void)CheckKeyWithString:(NSString *)string
  {
     //foreach key in NSMutableDictionary
     for(id key in dictobj)
       {
         //Check if key is equal to string
         if(key == string)// this is wrong since key is of type id and string is of NSString,Control doesn't come into this line
            {
             //do some operation
            }
       }
  }
  </code></pre>