On 01 Jan 2015, at 16:15, SevenBits <sevenbitst...@gmail.com> wrote:
> Uli: is it possible to create a category which defines a method called 
> containsString:, and only have it activate on 10.9 or lower and use the new 
> Apple method on 10.10 and above?

 In theory, you could add code on 10.8 and earlier that registers the IMP of 
sb_containsString: for the selector containsString: as well, using the ObjC 
runtime API, or put the category in a loadable bundle and not load that on 
10.10 and later, but I don’t recommend it as a general approach.

 It’s just too easy to run into conflicts with someone else’s category. Also, 
sometimes Apple privately implement a selector with different parameter types 
in an older OS version, then change its parameters but not the name before they 
make it public, and you’d end up failing to replace it (or worse, replacing it 
successfully and breaking the OS on the way).

 But yeah, unless you set the min *and* max OS version to <= 10.9, you prolly 
won’t get an error message when you use this selector.

Cheers,
-- Uli Kusterer
“The Witnesses of TeachText are everywhere...”
http://zathras.de


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to