• 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
[BUG] NSSelectorFromString Sometimes Lies
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[BUG] NSSelectorFromString Sometimes Lies


  • Subject: [BUG] NSSelectorFromString Sometimes Lies
  • From: Maurice Volaski <email@hidden>
  • Date: Sun, 18 May 2003 14:23:52 -0400

If one iterates through the metaclass of NSEvent, one will get 0x906bf8b8 as
the selector for the class method keyEventWithType:...

It would seem to follow that if one took this value and converted it back to
a string then back to a selector, it would be 0x906bf8b8, but it's not.
Instead, it's 0x9068d2a0.

The code below returns the correct string for the selector 0x906bf8b8 ,
which is keyEventWithType:...
NSLog(@"1 0x906bf8b8 string %@", NSStringFromSelector( 0x906bf8b8));


This code should return the selector 0x906bf8b8, but instead it returns
0x9068d2a0...
NSLog(@"2 selector from 0x906bf8b8 string %p",
NSSelectorFromString(NSStringFromSelector( 0x906bf8b8)));

Not surprisingly, 0x9068d2a0 does not return anything meaningful when
converted to a string.

--
Maurice Volaski, Flux Software email@hidden
http://www.fluxsoft.com/ ftp://ftp.fluxsoft.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • NSOutlineView expand by default?
      • From: Chris Silverberg <email@hidden>
    • Re: [BUG] NSSelectorFromString Sometimes Lies
      • From: Nat! <email@hidden>
  • Prev by Date: Re: [Q] How do I Create an NSEvent Using Runtime Functions?
  • Next by Date: Re: reading a text file
  • Previous by thread: Re: Tracking Rect Obtuseness
  • Next by thread: Re: [BUG] NSSelectorFromString Sometimes Lies
  • Index(es):
    • Date
    • Thread