• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Question about respondsToSelector
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about respondsToSelector


  • Subject: Re: Question about respondsToSelector
  • From: Andy Lee <email@hidden>
  • Date: Mon, 18 Aug 2008 16:33:03 -0400

On Aug 18, 2008, at 2:17 PM, Carmen Cerino Jr. wrote:
Does the id type have enough information for the respondsToSelector method to work.

It's not whether the id type has information. It's whether the object itself is able to respond to a message, and that depends on what class the object is an instance of.


I have a class with an ivar of type id, and when I invoke the respondsToSelector method it fails when it should succeed.

When you have a problem, try to explain what you expected to happen and what actually happened. What results would have constituted success? What actually happened that you are calling failure? A crash? An error message? A value displayed that you weren't expecting? What object were you sending the respondsToSelector message to? What selector were you passing? What was the actual object in the id variable at the time?


I am assuming it should work fine, because if I skip checking with the respondsToSelector method and just make the call, it executes the method. Can someone please tell me what I am doing wrong?

It would be help if you post your code and describe what you are trying to do.


--Andy

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Question about respondsToSelector (From: "Carmen Cerino Jr." <email@hidden>)

  • Prev by Date: Re: Question about respondsToSelector
  • Next by Date: Re: Question about respondsToSelector
  • Previous by thread: Re: Question about respondsToSelector
  • Next by thread: Re: Question about respondsToSelector
  • Index(es):
    • Date
    • Thread