How can I find out if an object implements a particular method?
As suggested, you can use respondsToSelector:
message declared on NSObject
. The provided code would be like
if ([element respondsToSelector:@selector(lowercaseString)]) {
// ... do work
}
Look at NSObject's respondsToSelector method