Re: Framework versioning and handling multiple OS SDK's?
Re: Framework versioning and handling multiple OS SDK's?
- Subject: Re: Framework versioning and handling multiple OS SDK's?
- From: Greg Parker <email@hidden>
- Date: Tue, 8 Sep 2009 15:33:57 -0700
On Sep 8, 2009, at 3:25 PM, Brent Gulanowski wrote:
For selectors, you can check whether NSSelectorFromString(@"selector")
returns a selector.
That won't do what you want. NSSelectorFromString() always returns a
selector; it creates one itself if that name has not been used yet.
(And "not used yet" differs from "does not exist" anyway; the runtime
manipulates selectors as lazily as it can.)
Try these instead:
[NSClassFromString(@"SomeClass") respondsToSelector:@selector
(someClassMethod)];
[NSClassFromString(@"SomeClass")
instancesRespondToSelector:@selector(someInstanceMethod)];
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
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