-methodForSelector: doesn't fail when it should
-methodForSelector: doesn't fail when it should
- Subject: -methodForSelector: doesn't fail when it should
- From: Andrew Duncan <email@hidden>
- Date: Mon, 23 Sep 2002 16:32:24 -0700
Cocoa docs say that calls to -methodForSelector: will cause a
runtime error if the specified selector is not handled. But I can
call [[NSObject new] methodForSelector:@selector(glog)] and get an
apparently valid pointer back. It's in the same memory range as the
result I get back from asking about a valid selector like self.
Apparently even though "glog" doesn't appear as a method name
anywhere, it gets a valid SEL pointer set up. But that's a side-issue.
Surely I shouldn't get a valid result from -methodForSelector:.
What's up? How do I detect failure, apart from checking first with
-respondsToSelector:?
_______________________________________________
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.