Does anyone know how to use system.isFunctionAvailable with a Cocoa function/selector?
Right now I’m comparing AppKitVersion to determine if features are available, but I’d rather use the above function. Just I’m not getting anywhere, as I cannot figure out how to specify a selector of a NSClass.
[quote=110666:@Sam Rowlands]Does anyone know how to use system.isFunctionAvailable with a Cocoa function/selector?
Right now I’m comparing AppKitVersion to determine if features are available, but I’d rather use the above function. Just I’m not getting anywhere, as I cannot figure out how to specify a selector of a NSClass.[/quote]
Use respondsToSelector:.
Hi Joe, thanks… How can I determine if that object exists in the first place?
So lets say I want to know if I can use the sharing services on 10.8, for this I need to use the class “NSUserNotification”. So how can I test to see if that class exists?
use a function to lookup classes from the objc runtime. If it returns nil it’s not there.
Thanks Christian, this is what I did in the end.