• 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: Framework versioning and handling multiple OS SDK's?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Framework versioning and handling multiple OS SDK's?
      • From: Brent Gulanowski <email@hidden>
References: 
 >Framework versioning and handling multiple OS SDK's? (From: aaron smith <email@hidden>)
 >Re: Framework versioning and handling multiple OS SDK's? (From: Brent Gulanowski <email@hidden>)

  • Prev by Date: Re: Framework versioning and handling multiple OS SDK's?
  • Next by Date: NSUserDefaults synchronization in Foundation tools
  • Previous by thread: Re: Framework versioning and handling multiple OS SDK's?
  • Next by thread: Re: Framework versioning and handling multiple OS SDK's?
  • Index(es):
    • Date
    • Thread