• 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: Newbie query re notifications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie query re notifications


  • Subject: Re: Newbie query re notifications
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Fri, 6 Mar 2009 22:14:12 +0100


Le 6 mars 09 à 21:25, Paul Sanders a écrit :

I'd suggest using:
-Wundeclared-selector

j o a r

Excellent. Thank you.

Of course you can put anything. Else how would you be able to create a
method and a selector at runtime ?

So how does the compiler map any old string to a SEL (which is just a
number)? Is it some kind of hash (in which case how can you be sure it is
unique) or is it something else? Inquiring minds want to know.

Conceptually:

It defined a selector reference:

SEL * _arbitrary_string_selector;

and then @selector(my_arbitrary_string) is replaced by *_arbitrary_string_selector;

It also generates some data in the __OBJC segment of the binary to tell the objc runtime to initialize the selector pointed by the reference at load time.

@selector() is not considered as a constant value. You cannot use it in static initialization for example (the compiler will report an error).


_______________________________________________

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: 
 >Re: Newbie query re notifications (From: Matt Neuburg <email@hidden>)
 >Re: Newbie query re notifications (From: "Paul Sanders" <email@hidden>)
 >Re: Newbie query re notifications (From: Joar Wingfors <email@hidden>)
 >Re: Newbie query re notifications (From: "Paul Sanders" <email@hidden>)

  • Prev by Date: Re: Using NSExceptionHandler causes a linker error
  • Next by Date: Re: NSImage/NSBitmapImageRep color shifts when creating scaled copy
  • Previous by thread: Re: Newbie query re notifications
  • Next by thread: Supported platforms?
  • Index(es):
    • Date
    • Thread