title: respondsToSelector to an id type object
body: <p>In my class there is a method let say <code>-aMethod:</code> which takes an <code>id</code> type parameters and doing some operation with that object. Now I want to call a method let say <code>-someMethod</code> of that object. But the problem is object type is <code>id</code> and I can't cast it as I don't know which type of object will be come here. Below my code but it's showing error <code>no know instant method for the selector someMethod</code>. Can any body help to handle that type of situation.</p>
  
  <p>I don't want to use block or delegate.</p>
  
  <pre><code>- (void)aMethod:(id)anObject
  {
      // other stuff
      if([anObject respondsToSelector:@selector(someMethod)]) [anObject someMethod];
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/66bMX.png" alt="enter image description here"></p>