[BUG] NSSelectorFromString Sometimes Lies
[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.