• 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: respondsToSelector - #import OR compiler warnings?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: respondsToSelector - #import OR compiler warnings?


  • Subject: Re: respondsToSelector - #import OR compiler warnings?
  • From: Ken Thomases <email@hidden>
  • Date: Mon, 29 Dec 2008 23:09:57 -0600

On Dec 29, 2008, at 10:56 PM, Kyle Sluder wrote:

On Mon, Dec 29, 2008 at 11:49 PM, Steve Cronin <email@hidden> wrote:
Call me finicky if you want but I love spanking clean compiles.

Not finicky; appropriately cautious. But this is going to happen whenever you start deciding to invoke methods based on -respondsToSelector:. The compiler needs to know some aspects of the selector's type signature in order to generate the correct code. Otherwise it's going to start passing arguments on the stack when they should be in floating-point registers or making other such mistakes.

To be clear, it's not the -respondsToSelector: expressions that are causing the warnings, it's the eventual invocations of the methods when you decide that some object does respond to them.


If the method satisfies the signature requirements of one of the - performSelector:... methods (defined in the NSObject _protocol_), then you can use those to side-step the compiler warning.

Cheers,
Ken

_______________________________________________

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


  • Follow-Ups:
    • Re: respondsToSelector - #import OR compiler warnings?
      • From: Bill Bumgarner <email@hidden>
References: 
 >respondsToSelector - #import OR compiler warnings? (From: Steve Cronin <email@hidden>)
 >Re: respondsToSelector - #import OR compiler warnings? (From: "Kyle Sluder" <email@hidden>)

  • Prev by Date: NSOutlineView
  • Next by Date: iTunes Scripting Bridge examples?
  • Previous by thread: Re: respondsToSelector - #import OR compiler warnings?
  • Next by thread: Re: respondsToSelector - #import OR compiler warnings?
  • Index(es):
    • Date
    • Thread