Use respondToSelector: to check for navigation controller.

Also updated the project file to be 6.0-compatible.