lundi 23 novembre 2015

Check if method/property in AppDelegate exists

I try to find out if the AppDelegate contains a certain property/method. For this I found Check if a property exist in a class and How to check whether an object has certain method/property?, but the AppDelegate seems to be different.

The following will not compile

if(AppDelegate.HasMethod("SomeMethod"))

because

AppDelegate does not contain a defintion for HasMethod.

I also tried other variations but I didn't get it managed to successfully check if the method/property exists or not. Furthermore respondsToSelector seems not to be applicable here. GetType() is also not available for AppDelegate.

What is the correct way for checking if a property/method in AppDelegate exists?





Aucun commentaire:

Enregistrer un commentaire