I wat to do something like this:
if (viewController.mapView) [viewController.mapView someMethod];
However, if mapView is not a class variab
For ordinary selectors, you can use respondsToSelector:. I'm not certain if this will work for new-style property access (as it appears you are using in this example). To test if a class responds to a given selector, use instancesRespondToSelector:.
respondsToSelector:
instancesRespondToSelector: